text:
Prime or highest factor
Challenge:
Given an array of non-negative whole numbers numbers in the range of 0 to Infinity, Check whether all of them are primes or not. (You can take input as a string too if you want)
Input:
Input: An array of numbers
Output: The array with every element replaced by one of these:
-1                 -----> If 0, 1
1                  -----> If it is a prime number greater than 1
the highest factor -----> If that number is not prime

Return either -1 (0, 1), 1 (for primes >= 2) or the highest factor of given number (for non-primes)
Examples:
[1, 2, 3, 4, 10, 11, 13]                        ---> [-1, 1, 1, 2, 5, 1, 1]
[100, 200, 231321, 12312, 0, 111381209, 123123] ---> [50, 100, 77107, 6156, -1, 1, 41041]

Note:
Input will always be valid, i.e it will consist only of numbers and decimals are not tested for. The array can be empty, if so, return the empty array.
Restriction:
This is code-golf so shortest code in bytes for each language wins.
LeaderBoard :
Here is a Stack Snippet to generate both a regular leaderboard and an overview of winners by language.
To make sure that your answer shows up, please start your answer with a headline, using the following Markdown template:
# Language Name, N bytes

where N is the size of your submission. If you improve your score, you can keep old scores in the headline, by striking them through. For instance:
# Ruby, <s>104</s> <s>101</s> 96 bytes

If there you want to include multiple numbers in your header (e.g. because your score is the sum of two files or you want to list interpreter flag penalties separately), make sure that the actual score is the last number in the header:
# Perl, 43 + 2 (-p flag) = 45 bytes

You can also make the language name a link which will then show up in the leaderboard snippet:
# [><>](http://esolangs.org/wiki/Fish), 121 bytes

var QUESTION_ID=163882,OVERRIDE_USER=8478;function answersUrl(e){return"https://api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function commentUrl(e,s){return"https://api.stackexchange.com/2.2/answers/"+s.join(";")+"/comments?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+COMMENT_FILTER}function getAnswers(){jQuery.ajax({url:answersUrl(answer_page++),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){answers.push.apply(answers,e.items),answers_hash=[],answer_ids=[],e.items.forEach(function(e){e.comments=[];var s=+e.share_link.match(/\d+/);answer_ids.push(s),answers_hash[s]=e}),e.has_more||(more_answers=!1),comment_page=1,getComments()}})}function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){e.items.forEach(function(e){e.owner.user_id===OVERRIDE_USER&&answers_hash[e.post_id].comments.push(e)}),e.has_more?getComments():more_answers?getAnswers():process()}})}function getAuthorName(e){return e.owner.display_name}function process(){var e=[];answers.forEach(function(s){var r=s.body;s.comments.forEach(function(e){OVERRIDE_REG.test(e.body)&&(r="
"+e.body.replace(OVERRIDE_REG,"")+"
")});var a=r.match(SCORE_REG);a&&e.push({user:getAuthorName(s),size:+a[2],language:a[1],link:s.share_link})}),e.sort(function(e,s){var r=e.size,a=s.size;return r-a});var s={},r=1,a=null,n=1;e.forEach(function(e){e.size!=a&&(n=r),a=e.size,++r;var t=jQuery("#answer-template").html();t=t.replace("{{PLACE}}",n+".").replace("{{NAME}}",e.user).replace("{{LANGUAGE}}",e.language).replace("{{SIZE}}",e.size).replace("{{LINK}}",e.link),t=jQuery(t),jQuery("#answers").append(t);var o=e.language;/s.lang?1:e.lang<s.lang?-1:0});for(var c=0;c<t.length;++c){var i=jQuery("#language-template").html(),o=t[c];i=i.replace("{{LANGUAGE}}",o.lang).replace("{{NAME}}",o.user).replace("{{SIZE}}",o.size).replace("{{LINK}}",o.link),i=jQuery(i),jQuery("#languages").append(i)}}var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe",COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk",answers=[],answers_hash,answer_ids,answer_page=1,more_answers=!0,comment_page;getAnswers();var SCORE_REG=/<h\d>\s*([^\n,]*[^\s,]),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/,OVERRIDE_REG=/^Override\s*header:\s*/i;
body{text-align:left!important}#answer-list,#language-list{padding:10px;width:290px;float:left}table thead{font-weight:700}table td{padding:5px}
 <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">

Leaderboard

	Author	Language	Size

Winners by Language

Language	User	Score

{{PLACE}}	{{NAME}}	{{LANGUAGE}}	{{SIZE}}	Link

{{LANGUAGE}}	{{NAME}}	{{SIZE}}	Link

I highly recommend using the Sandbox for future questions, to provide feedback on questions before posting them

@Joking : for infinity you must output all numbers upto infinity. This is just for you and you also have to make sure it doesn't time out or anything. JK : time out error is the most likely thing you will get for infinity

@Joking : noted will do

guess that works too. Updated

There is a leaderboard stack snippet here that you can use so you don't have to update the leaderboard manually

just wanted to note that in "If it is a prime number greater than 1" greater than 1 really is not necessary because prime numbers are always greater than 1

Why array input only for a map?

@l4m2 : What ? I don't understand what you mean

@IvoBeckers : in case someone forgot that primes > 1

Define highest factor. Should I return the number itself? The highest divisible prime? The highest factor that isn't itself?

I take it our programs are only required to work for integers up to our chosen language's max integer size (for those that don't have support for arbitrarily large integers)

Yep (better be above 1e5 atleast. Not necessary)

What @l4m2 means is that it's a little strange to make the challenge "do this to every number in a list" instead of just "do this to an input number" -- because now the core of every answer is wrapped in an inessential for loop or map() call.

"The highest factor" of a positive number n is n. From your test cases, it seems you actually mean "the highest factor less than the number itself".

Jelly,  7 6 bytes
ÆḌṪ€o-

A monadic link accepting a list of non-negative integers and returing a list of integers greater than or equal to -1.
Try it online!
How?
Note that:

All primes have a single proper divisor (one)
All composites have multiple proper divisors (one plus the others)
No number has itself as a proper divisor
Jelly's get-proper-divisors atom, ÆḌ, yields a list of proper divisors in ascending order
Zero and one have no proper divisors (they are neither prime, nor composite)
Applying Jelly's tail atom, Ṫ, to an empty list yields zero
No number has a proper divisor of zero (let alone being the maximal one)
All non-zero numbers are truthy in Jelly, while zero is falsey

ÆḌṪ€o- | Link: list of integers   e.g. [ 0, 1,  2,  5,     10,    5183]
ÆḌ     | proper divisors (vectorises)  [[],[],[1],[1],[1,2,5],[1,71,73]]
  Ṫ€   | tail €ach                     [ 0, 0,  1,  1,      5,      73]
     - | literal minus one
    o  | logical OR (vectorises)       [-1,-1,  1,  1,      5,      73]

Jelly, 9 8 bytes
Saved 1 byte thanks to @Dennis
:ÆfṂ€$~~

Try it online! or run all test cases
Commented
We take advantage of the fact that both nan and inf become 0 in Jelly when a bitwise NOT is applied to them.
:ÆfṂ€$~~ - main link, taking the input list
 ÆfṂ€$   - treat these two links as a monad:
 Æf      -   get the lists of prime factors (0 --> 0; 1 --> empty list; prime --> itself)
    €    -   for each list,
   Ṃ     -   isolate the minimum prime factor (turns empty lists into 0)
:        - divide each entry by its minimum prime factor (0/0 --> nan; 1/0 --> inf)
      ~~ - bitwise NOT x2 (nan or inf --> 0 --> -1; other entries are unchanged)

You didn't use JavaScript this time ? nice answer btw

I really like the ~~. :ÆfṂ€$~~ saves a byte by eliminating the helper link.

@Dennis Ah! $ is what I was looking for. :) Thanks!

R, 68 62 bytes
Map(function(n,v=rev(which(!n%%1:n)))"if"(n<2,-1,v[2]),scan())

A solution using only base R, no libraries! Thanks to Giuseppe for golfing away 6 bytes.
Uses scan to read in a space separated list of numbers, %% to identify which are factors. v then contains a vector of all factors in ascending order (including 1 and n). This has the nice property that when we reverse v, the number we want will be in the second place, avoiding an expensive call to length or tail(if n was prime, v contains n 1, else it contains n (factors in descending order) 1).
Example output (TIO link here):
> Map(function(n,v=rev(which(!n%%1:n)))"if"(n<2,-1,v[2]),scan())
1: 0 1 2 3 4 5 6 7 8 9
11:
Read 10 items
[[1]]
[1] -1

[[2]]
[1] -1

[[3]]
[1] 1

[[4]]
[1] 1

[[5]]
[1] 2

[[6]]
[1] 1

[[7]]
[1] 3

[[8]]
[1] 1

[[9]]
[1] 4

[[10]]
[1] 3

If you think a list is not an acceptable return type, then swap out Map for sapply and add 3 bytes.

62 bytes

nice — didn't think to initialise with !

05AB1E, 11 9 8 bytes
Ñε¨àDd<+

-3 bytes thanks to @Emigna, changing ©d1-®+ to Dd<+ and €¨€à to ε¨à.
Only my second 05AB1E answer, so can definitely be golfed.
Try it online.
Explanation:
Ñ           # Divisors of each item in the input-list (including itself)
            #  [1,2,10,3] → [[1],[1,2],[1,2,5,10],[1,2,3]]
 ε          # For each:
  ¨         #  Remove last item (so it's now excluding itself)
            #   [[1],[1,2],[1,2,5,10],[1,2,3]] → [[],[1],[1,2,5],[1,2]]
   à        #  And get the max
            #   [[],[1],[1,2,5],[1,2]] → ['',1,5,2]
    D       # Duplicate the list
     d      # Is it a number (1 if it's a number, 0 otherwise)
            #  ['',1,5,2] → [0,1,1,1]
      <     # Subtract 1
            #  [0,1,1,1] → [-1,0,0,0]
       +    # Add both lists together
            #  ['',1,5,2] and [-1,0,0,0] → ['-1',1,5,2]

Dd<+ should work instead of ©d1-®+. You also don't need the ï as they are still ints. You could have it in the footer for nicer looking output though.

@Emigna Ah, 1- instead of < was pretty stupid.. Thanks for the D instead of ©...®! And I've indeed put the ï in the footer now.

Or even better: Ñε¨àDd<+

Much better than my 12-byter.

J, 21 bytes
_1:`(%{.@q:)@.(>&1)"0

Try it online!
Explanation:
(>&1)"0 is each number greater than 1?
@. if not, return _1:
(%{.@q:) if its 2 or greater, divide % the number by the first {.of the prime factors q:

Japt, 6 bytes
After golfing, ended up being almost identical to, and just as short as, Jonathan's solution.
®â¬ÌªJ

Try it

Explanation
®          :Map
 â¬        :  Proper divisors
   Ì       :  Get last element (returns null if the array is empty)
    ª      :  Logical OR
     J     :  -1

Save a byte with -m

Java 8, 105 103 87 bytes
a->{for(int i=a.length,n,x;i-->0;a[i]=n<2?-1:n/x)for(n=a[i],x=1;++x<n;)if(n%x<1)break;}

Modifies the input-array instead of returning a new one to save bytes.
Try it online.
Explanation:
a->{                  // Method with integer-array parameter and no return-type
  for(int i=a.length,n,x;i-->0;
                      //  Loop backward over the array
      a[i]=           //    After every iteration: change the current item to:
           n<2?       //     If the current item is 0 or 1:
            -1        //      Change it to -1
           :          //     Else:
            n/x)      //      Change it to `n` divided by `x`
     for(n=a[i],      //   Set `n` to the current item
         x=1;++x<n;)  //   Inner loop `x` in range [2,`n`)
       if(n%x<1)      //    If `n` is divisible by `x`:
         break;}      //     Stop the inner loop (`x` is now the smallest prime-factor)
                      //   (if the loop finishes without hitting the `break`,
                      //    it means `n` is a prime, and `x` and `n` will be the same)

Python 3, 62 bytes
lambda l:[max([k for k in range(1,n)if n%k<1]+[-1])for n in l]

Try it online!
For 0 and 1 range(1,n) is empty, therefore the code evaluates to max([]+[-1]) = -1. For prime numbers, the only divisor in the [1, n) is 1, which is the desired output.

Coconut, 50 bytes
map$(n->max([k for k in range(1,n)if n%k<1]+[-1]))

Try it online!

Haskell, 52 49 bytes
map(\x->last$[d|d<-[1..x-1],mod x d<1]++[-1|x<2])

Try it online!
map                     -- for each element in the input array
  \x->                  -- apply the lambda function
    last                -- pick the last element of the following list
     [d|d<-[1..x-1]     --  all d from 1 to x-1
           ,mod x d<1]  --    where d divides x
     ++[-1|x<2]         --  followed by -1 if x<2

Husk, 8 bytes
m(|_1→hḊ

Try it online!
Explanation
m(|_1→hḊ  Implicit Input         [1,2,3,4,10]
m(        Map each element
       Ḋ    List of divisors     [[1],[1,2],[1,3],[1,2,4],[1,2,5,10]]
     →h     Penultimate element  [0,1,1,2,5]
  |_1       If falsy then -1     [-1,1,1,2,5]

Attache, 23 bytes
@{Max&-1!Divisors@_@-2}

Try it online!
29 bytes, pointfree: @(Max&-1@Last@ProperDivisors)
24 bytes, also pointfree: @(Max&-1@`@&-2@Divisors)
This simply gets the second-to-last divisor of n then takes the max of it and -1. The second-to-last element in an array with less than two elements is nil, and Max[-1, nil] is -1. @ simply vectorizes this function, making it apply to each atom.

Brachylog, 10 bytes
{fkt|∧_1}ˢ

Try it online!
The following explanation is mostly phrased imperatively for the sake of brevity, and does not accurately reflect Brachylog's declarative nature.
{          Start of inline predicate.
           Implicit input to the predicate.
 f         Create a list of all of the input's factors (including itself).
  k        Remove the last item of this list so that it no longer contains the original number.
   t       Take the last item of the list with the last item removed.
           Implicitly unify the output with the aforementioned last item.
    |      If that failed, because one of the lists was empty...
     ∧     discarding the input, (there's probably some obvious reason ∨ won't work here but I don't know what it is)
      _1   unify the output with -1 instead.
        }  End of the inline predicate.
         ˢ For every item of the input, unify it with the predicate's input and get a list of the corresponding outputs.

I decided I'd learn Brachylog so I could have some fun with code golf while hoping to learn some of the behavior of actual Prolog through osmosis, and I'm really enjoying it so far, even if I'm not entirely sure how the execution control characters work.

"there's probably some obvious reason ∨ won't work here but I don't know what it is" -> You can use .∨ instead of |∧ (I'm guessing you forgot the .), but it's the same byte count. Welcome to PPCG (and Brachylog more importantly :p) by the way!

Ah, of course! Thanks.

You can ask these kinds of questions on Brachylog in the Brachylog chat room

Wolfram Language (Mathematica), 33 bytes
Divisors[#][[-2]]/._Part:>-1&/@#&

Try it online!

R + numbers, 88 79 bytes
Thanks to the comments for some advice mainly about how to make submissions.
function(y)sapply(y,function(x)"if"(x<2,-1,prod(numbers::primeFactors(x)[-1])))

Uses the product of all prime factors except the smallest one, and the fact that the product of elements of an empty vector is defined to be 1.
Try it online!

saves bytes to omit the library call and use numbers::primeFactors directly.

here's a TIO link to see what JDL is suggesting, as well as swapping this to an anonymous function.

JavaScript (Node.js), 6155 bytes
-6 bytes thanks to @shaggy
_=>_.map(_=>eval('for(v=_/(d=_>>1);v!=~~v;v=_/--d);d'))

Try it online!

Explanation :
_ =>                                     // input i.e : the original array
    _.map(                               // map over all elements of the array
        eval('                           // eval a string
            for(v=_/(d=_>>1);            // set v = _ / _ >> 1 and set that to d
                v!=~~v;                  // and keep going until v !== floor(v)
                        v=_/d--);        // to _ / d again (d was changed)
                    d'                   // return d
            ))                           // end eval and map and function

This is still for old code haven't updated this.
ES5 friendly as well:
 const primeOrNot = function(input) { // the function with argument input
      return input.map(function(value) { // returns the array after mapping over them
           d = Math.floor(value * 0.5); // multiply each element by 0.5 and floor it
           for(let v = value / d; v != Math.floor(v);) { // for loop goes until v!=~~v
                d --; // subtract one from d
                v = value / d; // set v again to value / d
           }
           return d; // return d
      })
 };

55 bytes

Stax, 14 13 bytes
ü±p╞Ö*«òτ♀╣â▀

Run and debug it
Explanation (unpacked):
m|fc%c{vsH1?}U? Full program, implicit input-parsing
m               Map
 |fc%c            Get factorisation and length of it (0 and 1 yield [])
      {     } ?   If length != 0:
       v            Decrement
           ?        If still != 0:
        sH            Last element of factorisation
           ?        Else:
          1           Push 1
              ?   Else:
             U      Push -1

Pseudocode inside map:
f = factorisation(i)
l = length(f)
if l:
    if --l:
        return f[-1]
    else:
        return 1
else:
    return -1

Pari/GP, 37 bytes
a->[if(x<2,-1,x/divisors(x)[2])|x<-a]

Try it online!

Japt, 14 11 8 bytes
®/k v)ªÉ
®        // For each input number,
 /k v    // return the number divided by it's first prime factor,
     )ªÉ // or -1 if such a number doesn't exist (the previous result is NaN).

Try it online!
Shaved off those three pesky bytes thanks to Shaggy.

You don't need to filter the primes - k returns the prime factors of N - so this becomes 8 bytes: ®/k v)ªÉ

@Shaggy Thanks, didn't know it only returns the prime factors since the method docs don't say that.

Oh, yeah, forgot that. Been meaning to submit a PR for that for a while; will do so shortly.

J, 14 bytes
1(%0{q:,-)@>.]

Try it online!
For every number n take the maximum of (n,1) instead.
Append the negated number to the list of its prime factors (empty list for 1), and divide the number by the first item in the list.
Also 14 bytes
(%0{q:) ::_1"0

Try it online!
Divide every number by the first of its prime factors. 0 raises a domain error with q:, and we look for the 0th item in an empty list for 1 — that’s an error as well. For any number that errors, return −1.

Very nice solutions!

Pyth, 12 bytes
me+_1f!%dTSt

Try it here
Explanation
me+_1f!%dTSt
m            Q    For each number d in the (implicit) input...
          Std     ... get the range [1, ..., d - 1]...
     f!%dT        ... take the ones that are factors of d...
  +_1             ... prepend -1...
 e                ... and take the last.

Bash + GNU utilities, 49

9 bytes saved thanks to @Cowsquack

factor|sed '/:$/c-1
/: \w+$/c1
s%: %/%
y/ /#/'|bc

Explanation

factor reads input numbers from STDIN, one per line and outputs in the format <input number>: <space-separated list of prime factors (ascending)>
sed processes this as follows:

/:$/c-1 The input numbers 0 and 1 have no prime factors and are replaced with -1
/: \w+$/c1 Numbers with one prime factor (themselves) are prime.  Replace these with 1
s%: %/% Replace : with /.  This builds an arithmetic expression to divide the (non-prime) input number by its smallest prime factor to give the largest factor
y/ /#/ Remove the list of other (unneeded) factors (by commenting out)

bc Arithmetically evaluate and display

Try it online!

You might be able to drop the -r, and for the first two s's you can use /regex/cvalue to golf a byte, simplifying this regex further can save more, and you can save a byte in the last two regex's by only replacing the : with the /, and then commenting out the unwanted part, like so, https://tio.run/##JYlBCoMwFET3c4qABhdSfuZ/F5qzdKOxxZ3QFETw7mmki@E93ixz3kp5z@m7f678Wl0nsZX0ICS659FXJ04fvXhkcdKIdteSSiEUhgEMIEGrEqD3jKa1VCrukzZSw/Qv9gM

@Cowsquack very good - thanks!

Python 2, 61 59 bytes
lambda x:[max(k for k in[-1]+range(1,n)if n%k<1)for n in x]

Try it online!

Improvements

61 to 59 bytes by Dennis.

JavaScript (Node.js), 37 bytes
x=>x.map(a=>(f=t=>a%--t<1?t:f(t))(a))

Try it online!
Recursive, stack overflow for large input
JavaScript (Node.js), 41 bytes
x=>x.map(a=>eval('for(t=a;a%--t!=0;);t'))

Try it online!

Racket, 105 bytes
(λ(L)(map(λ(n)(if(< n 2)-1(p n(- n 1))))L))(define(p n d)(if(= d 1)1(if(=(modulo n d)0)d(p n(- d 1)))))

Try it online!

Befunge-98 (FBBI), 39 bytes
j&:!+f0p1-1:::' -:!j;3k$.nbj;-\%!!j:1+a

Try it online!
Ends with the & when there are no more numbers. This causes the program to stall for 60 seconds until TIO ends the program. This is unavoidable for Befunge-98, at least on TIO because both interpreters do this. After hitting play, you can stop the program after a bit in order to see what would be output if you did wait the minute.

Essentially, for every new number, if it is 0, it turns it into a 1. Then it puts a -1 onto the stack followed by a number that starts from 1 and counts up until it reaches the input number, in which case it prints out the second number on the stack (-1 for an input of 0 or 1, and the highest factor for others). Every time through the loop, we add the value of the iterator to the stack behind it if (input % iterator == 0). This means that when we get to the input, we just have to throw away the iterator and print. Then, we clear the stack with n and return to the read input function.
I may expand of the explanation later, we'll see...

Retina 0.8.2, 33 bytes
%(`^0|^1$
-1
\d+
$*
^(1+)\1+$
$.1

Try it online! Link includes those test cases that aren't too slow. Explanation:
%(`

Loop over each input number.
^0|^1$
-1

Special-case 0 and 1.
\d+
$*

Convert to unary (doesn't affect -1).
^(1+)\1+$
$.1

Replace each number with its largest proper factor in decimal.

tinylisp, 75 bytes
(load library
(q((L)(map(q((N)(i(l N 2)(- 1)(/ N(min(prime-factors N))))))L

Try it online! (Contains 4 extra bytes to give the anonymous function a name so we can call it in the footer.)
Ungolfed/explanation
Observe that returning 1 for prime \$n\$ and the largest factor less than \$n\$ for composite \$n\$ can be combined into returning \$n/p\$ where \$p\$ is the smallest prime factor of \$n\$.
(load library)               Library gives us map, -, /, min, and prime-factors functions

(lambda (L)                  Anonymous function, takes a list of numbers L
 (map                         Map
  (lambda (N)                  Anonymous function, takes a number N
   (if (less? N 2)              If N < 2
    (- 1)                        -1; else
    (/ N                         N divided by
     (min                        the minimum
      (prime-factors N)))))      of the prime factors of N
  L)))                        ... to L


text:
Code 39 barcode encoder
Write a function or program that encodes a string into a Code 39 format barcode, where each character is encoded as five bars separated by four gaps. Either two of the bars and one of the gaps are wide and others are narrow (10*4 codes), or three of the gaps are wide and none of the bars are (4 codes). This gives 44 different codes, from which one is a reserved code that is used to denote the start and end of the encoded string.
The challenge
The input is a string containing only characters from the set
1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ-. +/$%

The output is the string encoded as a barcode string. The narrow gap and intercharacter gaps are a single space and a wide gap is three spaces. The narrow bar is the UTF-8 byte sequence for the Unicode character "Full block", █, i.e. 0xE2 0x96 0x88 and wide bar is three such byte sequences / characters (███). The full list of codes is:
      Spaces
      0100 0010 0001 1000 1011 1101 1110 0111
Bars
00000                       +    /    $   %
10001   1    A    K    U
01001   2    B    L    V
11000   3    C    M    W
00101   4    D    N    X
10100   5    E    O    Y
01100   6    F    P    Z
00011   7    G    Q    -
10010   8    H    R    .
01010   9    I    S  space          1=wide
00110   0    J    T  start/end      0=narrow

The bars and spaces are interleaved, starting at a bar, so for example Q is
bar   0 0 0  1     1
code  █ █ █ ███   ███
space  0 0 0    1

After encoding all the characters, the string is delimited at both ends with █   █ ███ ███ █. The intercharacter gap, a single space, is inserted between every letter. Your solution may output trailing spaces and a trailing newline (in that order).
Examples
""     → "█   █ ███ ███ █ █   █ ███ ███ █"

"A"    → "█   █ ███ ███ █ ███ █ █   █ ███ █   █ ███ ███ █"

"C++"  → "█   █ ███ ███ █ ███ ███ █   █ █ █   █ █   █   █ █   █ █   █   █ █   █ ███ ███ █"

"GOLF" → "█   █ ███ ███ █ █ █ █   ███ ███ ███ █ ███ █   █ █ ███ █ █   ███ █ ███ ███   █ █ █   █ ███ ███ █"

Standard input/output formats are allowed and standard loopholes are disallowed. This is code-golf, so the shortest code measured in bytes wins!

May we use a printable ASCII character (you can choose which one to allow) instead of █?

For language like BrainFuck, what count as "one usage"?

@Angs I meant on the output basically, not in the code. It's not very fair to give penalties to uses of the # character, since, for example, "#" isn't the only reason it could be used in a language.

@EriktheOutgolfer What I meant was in string literals and the like, but considering l4m2's point it might be best to disallow it. After all, are there any languages that can't output three bytes?

@Angs Oh, I didn't push for it, I asked just in case.

@EriktheOutgolfer I'll disallow other output characters again for now, too many problems with that

If it helps anyone, here is a pastebin with all 9-bit binary Strings and decimal conversion for each character.

Here are codes which are reverses of each other

Charcoal, 90 bytes
⪫ＥＥ⪫**Ｓ⌕⁺⁺⭆…αχ﹪⊕μχα-. *+/$%ι⪫Ｅ⁵⁺⎇μ× ∨⁼›ι³⁹⁼²﹪⁻÷ι∨›ι³⁹χμ⁴¦³ω×█∨›ι³⁹∨§↨℅§.6':+3<-59ι²⊕μ³ω

Try it online! Note: Trailing space. Link is to verbose version of code. Explanation:
⪫ＥＥ⪫**Ｓ...⪫Ｅ⁵⁺...ω

Wrap the input string in *s and then map over it twice, finally joining the result with spaces. For the second map, there is then an additional map over the implicit range 0..4, where two substrings are concatenated, and those results are then joined with the predefined empty string constant.
⌕⁺⁺⭆…αχ﹪⊕μχα-. *+/$%ι

For the first inner map, create a string formed by taking the incremented digits, the uppercase alphabet, and the symbols -. *+/$%, and look up the position of the mapped input character. For example, C++ would map to [12, 40, 40].
⎇μ× ∨⁼›ι³⁹⁼²﹪⁻÷ι∨›ι³⁹χμ⁴¦³ω

The first substring represents the spaces before the bars. There is nothing before the first bar, but the other bars depend on the position of the mapped input character: if it is over 39, then only one place has a single space, while if it is under 40, then only one place has three spaces, and the position is also converted to a column by dividing it by 10. If the column and the loop index differ by 2 (modulo 4) then that is the odd place out.
×█∨›ι³⁹∨§↨℅§.6':+3<-59ι²⊕μ³

The second substring represents the bars. If the position is over 39 then there is always one bar otherwise the position is looked up in an array of bits mapped to characters. For instance, if the position is 12, then that is circularly indexed to the character ', which is 100111 in binary, indicating wide bars in columns 1 and 2. (The leading 1 is ignored, it simply ensures a consistent bit count.)

JavaScript (ES6), 225 212 bytes
Saved 4 bytes thanks to @l4m2
s=>`#${s}#`.replace(/./g,c=>'0202020202'.replace(/./g,(j,k)=>[C='█',C+C+C,' ','   '][(i="%+/$U1AKV2BLW3CMX4DNY5EOZ6FP-7GQ.8HR 9IS#0JT".indexOf(c),[170,257,260,5,272,17,20,320,65,68,80][i>>2]^2<<i%4*2)>>k&1|j]))

Try it online!
How?
The table can be rearranged such that the 9-bit binary mask of the character is quickly deduced from its row and column using the following formula:
n = m XOR (2 << k)

with:
  m  | k: 0   2   4   6
-----+------------------      Examples:
 170 |    %   +   /   $
 257 |    U   1   A   K         'G' = 320 XOR (2 << 4) = 320 XOR 32 = 352
 260 |    V   2   B   L
   5 |    W   3   C   M         '+' = 170 XOR (2 << 2) = 170 XOR 8  = 162
 272 |    X   4   D   N
  17 |    Y   5   E   O
  20 |    Z   6   F   P
 320 |    -   7   G   Q
  65 |    .   8   H   R
  68 |   spc  9   I   S
  80 |    #   0   J   T

s=>`#${s}#`.replace(/./g,c=>'0202020202'.replace(/./g,(j,k)=>[C='#',C+C+C,' ','   '][(i="%+/$U1AKV2BLW3CMX4DNY5EOZ6FP-7GQ.8HR 9IS#0JT".indexOf(c),[,257,260,5,272,17,20,320,65,68,80][i>>2]|(2<<i%4*2^(i<4)*170))>>k&1|j]))(221)

@l4m2 That doesn't seem to be valid. However, I've managed to find a fix for 221 bytes.

@EriktheOutgolfer I think that's basically what l4m2 submitted with a full block instead of '#'. Or am I missing something?

@Arnauld Their original doesn't space properly.

Red, 452 445 bytes
func[s][q: func[x y z][append/dup x y z]append insert s"*""*"b:
func[n][v: copy[]until[append v n % 2 * 2 + 1
1 > n: n / 2]q v 1 5 - length? v
reverse v]a: q":1234567890:ABCDEFGHIJ:KLMNOPQRST:UVWXYZ-. *"" "44
a/45: #"+"a/56: #"/"a/67: #"$"a/78: #"%"foreach t s[i: index? find a t
k: b pick[0 17 9 24 5 20 12 3 18 10 6]either 0 = j: i % 11[11][j]m:
b pick[8 4 2 16 22 26 28 14]i - 1 / 11 + 1 z: copy""repeat n 5[q z"█"k/(n)
q z" "m/(n)]prin z]]

Try it online!
I'll try to golf it further, but I don't expect much from this naive solution.

C (gcc), 311, 303 bytes
(*P)()=printf;i;j;w;m[]={170,257,260,5,272,17,20,320,65,68,80};char*b=" \0\xE2\x96\x88",*t="%+/$U1AKV2BLW3CMX4DNY5EOZ6FP-7GQ.8HR 9IS#0JT",*c;p(x){j=256;w=2;while(j){P(b+w);if(x&1){P(b+w);P(b+w);}x/=2;j>>=1;w=2*!w;}P(" ");}f(char*_){p(82);for(c=_;*c;c++){i=strchr(t,*c)-t;p(m[i>>2]^(2<<(i&3)*2));}p(82);}

Try it online!
-8 thanks to ceilingcat
Uses encoding strategy from Arnauld's answer. TIO link includes -w switch and boilerplate to remove warnings, these are unnecessary and thus not included in the score.
Aside from the encoding scheme as explained by Arnauld, the other trick here is to maintain the w variable as toggling between 2 and 0 (w=2*!w). This allows me to choose between the first and second strings in b. The first is a space, the second is the filled rectangle.

clever, you should post it :)

Java 10, 455 bytes
s->{String r="",R=r;for(var c:("~"+s+"~").split(""))r+=r.format("%9s",Long.toString(new int[]{148,289,97,352,49,304,112,37,292,100,52,265,73,328,25,280,88,13,268,76,28,259,67,322,19,274,82,7,262,70,22,385,193,448,145,400,208,133,388,196,138,162,168,42}["~1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ-. +/$%".indexOf(c)],2)).replace(' ','0');for(int l=r.length(),i=0,c;i<l;R+=""+(i%9%2<1?c<49?"█":"███":c<49?" ":"   ")+(i%9>7&++i<l?" ":""))c=r.charAt(i);return R;}

Try it online.
Explanation:
s->{                     // Method with String as both parameter and return-type
  String r="",           //  Temp-String, staring empty
         R=r;            //  Result-String, starting empty as well
  for(var c:("~"+s+"~")  //  Prepend and append "~" to the input
            .split(""))  //  And loop over each character
    r+=r.format("%9s",Long.toString(
                         //   Convert the following integer to a 9-bit binary String:
       new int[]{148,289,97,352,49,304,112,37,292,100,52,
                 265,73,328,25,280,88,13,268,76,28,259,67,322,
                 19,274,82,7,262,70,22,385,193,448,145,400,208,
                 133,388,196,138,162,168,42}
                         //    Array containing all decimal values of the binary Strings
       ["~1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ-. +/$%".indexOf(c)]
                         //    with the index based on the current character
   ,2)).replace(' ','0');
                         //   (also part of the integer to 9-bit binary String conversion)
  for(int l=r.length(),i=0,c;i<l;
                         //  Loop `i` over the temp-String
      R+=                //    After every iteration: append the following to the result:
         ""+(i%9%2<1?    //     If `i` modulo-9 modulo-2 is 0:
              c<49?      //      And `c` is '0':
               "█"       //       Append a single block
              :          //      Else:
               "███"     //       Append three blocks
             :c<49?      //     Else-if `c` is '0':
              " "        //      Append a single space
             :           //     Else:
              "   ")     //      Append three spaces
         +(i%9>7         //     If `i` modulo-9 is 8,
           &++i<l?       //     and this is not the very last character
            " "          //      Append a space delimiter
           :             //     Else:
            ""))         //      Append nothing more
    c=r.charAt(i);       //   Set `c` to the current character in `r`
  return R;}             //  Return the result

C (gcc), 241 239 227 213 207 bytes
#define P printf(i%2?" ":"█")
i;p(x){for(i=9;i--;x/=2)P,x&1&&P+P;P;}f(char*_){p(82);for(char*t="%+/$U1AKV2BLW3CMX4DNY5EOZ6FP-7GQ.8HR 9IS#0JT";*_;p(L"ªāĄ\5Đ\21\24ŀADP"[i/4]^2<<i%4*2))i=index(t,*_++)-t;p(82);}

Try it online!
Based on @LambdaBeta's implementation.
Slightly less golfed:
#define P printf(i%2?" ":"█")
i;
p(x){
 for(i=9;i--;x/=2)
  P,
  x&1&&
   P+
   P;
 P;
}
f(char*_){
 p(82);
 for(char*t="%+/$U1AKV2BLW3CMX4DNY5EOZ6FP-7GQ.8HR 9IS#0JT";*_;p(L"ªāĄ\5Đ\21\24ŀADP"[i/4]^2<<i%4*2))
  i=index(t,*_++)-t;
 p(82);
}

Perl 5, 244 bytes
$l="{ ,   ,...,.........}"x9;@h{$",qw($ % + - . /),0..9,'',A..Z}=(<"$l">)[q{..=9...Z.>>...J=9..j.%r1...=).[.>=-..Ux?V.^=8.>.6o+ax_.=(..B=,..Yx6..b=(..#r'p.^...G.<=,..Sx5B.\=(.V.It..z:..-z.=<6.}=~s/./ord$&/gre=~/.{6}/g];s/^|./$h{$&} /g;$\=$h{''}

Try it online!
Contains many unprintables and high-byte characters, TIO link provides an xxd representation. I'd hoped this would have ended up smaller, and I might still be able to pack the data in a more efficient way so I'll see how I go. This builds up all permutations of " ","   ","█","███" and then maps the indicies of the list to the corresponding characters.

Haskell, 275 270 bytes
z=0:z
x!0=[]
x!n=mod n x:x!div n x
e c|Just a<-lookup c.zip"W3YZ56C$EF. 89*HM/ORU1QGNTDJ7%40LSBIP2-+XVKA".((++)<*>(reverse<$>))$take 9.(++z).(2!)<$>scanl(+)7(67!0x117CDBC49F9EEEF11C3A659CACB31236)=zipWith(\l c->c<$[1..2*l+1])(a++[0])(cycle"█ ")>>=id
f s='*':s++"*">>=e

Try it online!
The operator x!n that calculates the x-base digits of n, is used twice to decompress the codes. The codes are compressed first as binary strings with wide = 1 and narrow = 0, with no regard to color, e.g. R↔10000110↔262. These numbers are then sorted and differenced to get numbers in the range [3,66], which are compressed with reverse of the binary digit algorithm as 0x117CDBC49F9EEEF11C3A659CACB31236. This contains only half of the codes, the rest are reverses of these.
Ungolfed:
z=0:z                       -- infinite zeroes for padding
x!0=[]                      -- digits of n in base x, recursion base case
x!n=mod n x:x!div n x       -- digits of n in base x
e c | Just a                -- read upwards from (*)
  <-lookup c                -- lookup code, given letter
  . zip"W3YZ56C$EF. 89*HM/ORU1QGNTDJ7%40LSBIP2-+XVKA"
                            -- combine codes with correct letters
  . ((++)<*>(reverse<$>))   -- concatenate list and list with reverse codes
  $ take 9                  -- take nine
  . (++z)                   -- pad with infinite zeroes on right
  . (2!)                    -- convert to binary digits – [[1,1,1],[1,0,1,1]…]
  <$> scanl (+) 7           -- cumulative sum starting from 7 – [7,13,19,22,25…]
        (67!0x117CDBC49F9EEEF11C3A659CACB31236)
                            -- (*) digits in base 67 – [6,6,3,3,3,9,5,7…]
  = zipWith
      (\l c->c<$[1..2*l+1]) -- combine width and color, length is 2*l+1
      (a++[0])              -- list of widths as 0/1, 0 added for interchar gap
      (cycle"█ ")           -- infinite list of bar colors, leftovers are unused
  >>=id                     -- concatenate
f s='*':s++"*">>=e          -- surround string with delimiters, map e and concat

source: Stack Exchange

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

sort: votes


text:
Detect Rectangular Text with Rectangular Code
Given a string of printable ASCII text (including newlines and spaces) that contains at least one character that is neither a newline nor a space, output a truthy value if the string is rectangular, and a falsey value otherwise. Additionally, the source code for your solution must be rectangular.
A string is rectangular if it meets all of the following conditions:

The first line and the last line contain no spaces.
The first and last character of each line is not a space.
All lines have the same number of characters.

For example, the following text is rectangular:
abcd
e fg
hijk

This text, however, is not rectangular (requirement #3):
1234
567
8900

Test Cases
Truthy:
sdghajksfg

asdf
jkl;

qwerty
u i op
zxcvbn

1234
5  6
7890

abcd
e fg
hijk

Falsey:
a b c

123
456
7 9

12
345

qwerty
 uiop
zxcvnm

1234
567
8900

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

Sandbox

Related.

So, a one-liner without any space is a valid submission, correct?

related

Can we take input as an array of strings, one for each line? Or must we input a single long string that includes the line breaks?

@Arnauld Yes, that is correct.

@BradC Either is fine, so long as it is unambiguous.

@Laikoni, the question says we'll be given a string that contains at least one character that is neither a newline nor a space.  That implies we don't need to handle an empty string.

Is the tab character (ASCII value 9) considered printable?

@JonathanFrech No

C (gcc), 127 125 124 118 bytes

Saved two bytes by golfing r*=!e&(!t|t==c); to r>>=e||t&&t-c;. (This golf was the inspiration for my recent C tips answer Inverse flag update.)
Saved a byte by golfing *(_-2) to _[~1].
Saved six bytes by golfing *_++-10||(...) to *_++<11?...:0 and utilizing the placeholder zero ...:0 (which is not used constructively) to golf the c++ increment. Those golfs allowed some further loop reshuffling.
When one can use multiple falsey values, 114 bytes could be possible.

r,e,c,t;_(char*_){for(r=1,t=c=0;*_;*_++<11?r*=(t||(t=c,!e))&*_>32&_[~1]>32&t==c,c=e=0:c++)*_-32||(e=1);r>>=e||t&&t-c;}

Try it online!
Source layout achieving a taller rectangle.
Explanation
The following explains the 124 bytes long version.
r,e,c,t;_(char*_){     // `r` is the boolean result flag, `e` a boolean flag if the current line contains
                       //  a space, `t` the first line's width, `c` the current line's current width
 for(r=1,t=c=0;*_;c++) // initialize, loop through entire string
  *_-32||              // if the current char is a space,
   (e=1),              //  the current line contains a space
  *_++-10||            // if the current char is a newline (char pointer `_` now incremented)
   (r*=(t||(t=c,!e))   // if t is not yet set, the current line is the first line; set it
                       //  to this line's length, check that no spaces where found
    &*_>32             // the next line's first char should not be a space
    &_[~1]>32          // this line's last char should not have been a space
    &t==c,c=~0,e=0);   // the line lengths should match, reset `c` and `e` to zero
                       //  (`~0 == -1`, countering the loop's increment of `c`)
 r>>=e||t&&t-c;}       // return boolean flag, check that the last line does not contain spaces,
                       //  there was either no newline or line lengths match
                       //  (here) equivalent to `r*=!e&(!t|t==c)`

Try it online!

Java 10, 214 176 169 152 144 139 bytes
s->{String[]a=s.split("\n")
;int r=1,i=0,R=a.length;for
(;i<R;i++)if(i<1|i>R-2?a[i]
.contains(" "):a[i].trim( )
!=a[i])r=0;return-r<0;}////

-5 bytes thanks to @Neil.
Uses String[]a instead of var a; return-r<0; instead of return r>0;; and added a comment // at the very end, so there aren't spaces on the first and last rows.
Note that this rectangle is shorter than a single-line input, because int r=1,...; should be replaced with int[]v{1,...};, and all uses of the integers would then becomes v[n] (where n is the index of the variable in the array v).
Try it online.
Explanation:
s->{                        // Method with String parameter and boolean return-type
  String[]a=s.split("\n");  //  Input split by new-lines
  int r=1,                  //  Result-integer, starting at 1
      i=0,                  //  Index `i`, starting at 0
      R=a.length;           //  Amount of rows `R`
  for(;i<R;i++)             //  Loop `i` over the rows
    if(i<1                  //   If it's the first row,
       |i>R-2?              //   or the last row:
        a[i].contains(" ")  //   And the current row contains a space
       :a[i].trim()!=a[i])  //   Or either column of the current row contains a space
      r=0;                  //    Set the result `r` to 0
   return-r<0;}             //  Return whether `r` is still 1
////                        // Comment to comply to the rules of the challenge

Here is the same base program with spaces (128 126 bytes):
s->{var a=s.split("\n");int r=1,i=0,R=a.length;for(;i<R;i++)if(i<1|i>R-2?a[i].contains(" "):a[i].trim()!=a[i])r=0;return r>0;}

-2 bytes thanks to @Neil.
Try it online.

https://tio.run/##tVRNT@MwEL3nVww@2SpNWz7KLmngtjc4tNwIB8dxUqeuHWynS4H@9uIWVishWncl1ooPE7@ZN196NV3Qbl3M1kxSa@GGCvUSAQjluCkp43C7MQFyrSWnChieOCNUBZYk/mHlr/@so04wuAUFKaxt9@rlHXX/QFMb20YKh1GmEIkSHxlMOjgWaf94nNJYclW5aVJqE@FEjMaJ6HSIKLEYDV7F1bh7ck3vxUMUM62cT85iBIhcwuZn7DnmmERH6cYiJu0nhrvWqK4Z9ZNVz5/1JsmmzaXP7iPJhRYFzH0o/CdHoOS9yF4P7kzrpsvLrTlZWsfnsW5d3HikkwqrmGFEc1b4Yjpb0I6DOJRVEDQV9QyRbSd309mimtJ6ZssqCKW2KIOk9UwmwUiPv7lxy2CsFgToJgh7fmKLXAVJByenZ8FY5wDDIOjix89@uFv/Z45@i35RaXlgiw4rdngBQZCv9YBiIQd2wATCdKdn59@1PtAK3cBB66Pm37Q@/9xRP8@Jbo3XQqYLDsJZLsv9s/1aATOUZSpDJEi/RySDvntENOj7V2QzBNknmQ1675Hhj16uotX6DQ

C++, 199 183 181 175 bytes

This template function accepts lines as a collection of strings (which may be wide strings), passed as a pair of iterators.
#include<algorithm>//
template<class I>bool
f(I a,I b){return!~+(
*a+b[-1]).find(' ')&&
std::all_of(a,b,[&a](
auto&s){return' '+-s.
back()&&s[0]-' '&&a->
size()==s.size();});}

Thanks are due to user Erroneous for reminding me of the back() member of std::string and for pointing out that npos+1 is zero.
Ungolfed equivalent
The only real golfing is to concatenate the first and last lines so we can perform a single find for spaces in those.
#include <algorithm>
template<class It>
bool f(It a, It b)
{
    return (*a+b[-1]).find(' ') == a->npos
        && std::all_of(a, b,
                       [=](auto s) {
                           return s.back() != ' '
                               && s.front() != ' '
                               && s.size() == a->size(); });
}

Test program
#include <iostream>
#include <string>
#include <vector>
int expect(const std::vector<std::string>& v, bool expected)
{
    bool actual = f(v.begin(), v.end());
    if (actual == expected) return 0;
    std::cerr << "FAILED " << (expected ? "truthy" : "falsey") << " test\n";
    for (auto const& e: v)
        std::cerr << "  |" << e << "|\n";
    return 1;
}
int expect_true(const std::vector<std::string>& v) { return expect(v, true); }
int expect_false(const std::vector<std::string>& v) { return expect(v, false); }

int main()
{
    return
        // tests from the question
        + expect_true({"sdghajksfg"})
        + expect_true({"asdf", "jkl;",})
        + expect_true({"qwerty", "u i op", "zxcvbn",})
        + expect_true({"1234", "5  6", "7890",})
        + expect_true({"abcd", "e fg", "hijk",})
        + expect_false({"a b c",})
        + expect_false({"123", "456", "7 9",})
        + expect_false({"12", "345",})
        + expect_false({"qwerty", " uiop", "zxcvnm",})
        + expect_false({"1234", "567", "8900",})
        // extra tests for leading and trailing space
        + expect_false({"123", " 56", "789"})
        + expect_false({"123", "45 ", "789"})
        // the function source
        + expect_true({"#include<algorithm>//",
                       "template<class I>bool",
                       "f(I a,I b){return!~+(",
                       "*a+b[-1]).find(' ')&&",
                       "std::all_of(a,b,[&a](",
                       "auto&s){return' '+-s.",
                       "back()&&s[0]-' '&&a->",
                       "size()==s.size();});}",})
        ;
}

This can be further golfed to 183 bytes with a line width of 22, using .find(' ')+1==0, and s.back() instead of *s.rbegin().

T-SQL, 237 207 bytes
SELECT(SELECT(IIF(max(len(v))=min(len(v)),1,0)*IIF(SUM(len(v+'x')-len
(trim(v))-1)=0,1,0))FROM t)*(SELECT(IIF(SUM(charindex(' ',v))=0,1,0))
FROM[t]WHERE[i]IN(SELECT(min(i))FROM[t]UNION(SELECT(max(i))FROM[t])))

Outputs 1 for rectangular, 0 otherwise. I had to use tons of extra parens and brackets to eliminate spaces, I'm sure there is vast room for improvement.
Explanation:
Per our allowed I/O options and clarification in the question comments, input is taken as separate rows in a pre-existing table t. Because data in SQL is inherently unordered, that table includes a "row number" identity field i:
CREATE TABLE t (i INT IDENTITY(1,1), v VARCHAR(999))

Basically my SQL performs 3 subqueries, each of which returns 0 or 1 based on the 3 criteria of "rectangular" code. Those 3 values are multiplied together, only returning 1 for code that satisfies all 3.
EDIT: Combined criteria 2 and 3 into the same SELECT to save space
SELECT(
SELECT(IIF(max(len(v))=min(len(v)),1,0)                  --All rows same length
      *IIF(SUM(len(v+'x')-len(trim(v))-1)=0,1,0))FROM t) --no leading or trailing spaces
*(SELECT(IIF(SUM(charindex(' ',v))=0,1,0))               --No spaces at all in
FROM[t]WHERE[i]IN(SELECT(min(i))FROM[t]                  --   first row or
            UNION(SELECT(max(i))FROM[t])))               --   last row

The TRIM(v) function is only supported by SQL 2017 and above. Earlier versions would need LTRIM(RTRIM(v)), which would require rebalancing the rows.
One random note: the LEN() function in SQL ignores trailing spaces, so LEN('foo  ') = 3. To get a "true" length you have to tack a character on to the end then subtract one :P

Haskell, 106 102 98 110 109 102 bytes
(\a->all(==[])a||and(e((1<$)<$>a):map(all(>='!').($a))[head,last,map$last,map$head]));e(a:s)=all(==a)s

Thanks to @nimi and @Laikoni for a byte each!
Try it online!

JavaScript (Node.js), 85 bytes
x=>(x=x.split`\n`).some(s=>s.length-x[0].length|s.trim()!=s)<!/\s/.test(x[0]+x.pop())

Try it online!

@KevinCruijssen sorry :(

I love your NOR operator!

Haskell, 79 bytes
g(x:r)=all((==(0<$x)).(0<$))r&&all(>='!')(x++last(x:r)++(head<$>r)++(last<$>r))

Try it online! Takes input as a list of lines.
The pattern g(x:r)= ... binds the first line to x and the (possibly empty) list of remaining lines to r. Then all((==(0<$x)).(0<$))r checks if all lines in r have the same length as x (Using this tip).
If not, then the conjunction && short-circuits and returns False, otherwise the right hand side is evaluated. There a string is build which consists of x for the first line, last(x:r) for the last line of r (or the first line again in case r is empty) and (head<$>r) for the first and (last<$>r) for the last character of each line. For this string, all(>='!') checks that it does not contain any spaces (we can't use (>' ') because of the source code restriction).

Errors on "\n\n"

@Angs Good catch. Luckily, OP clarified that the input contains at least one character that is neither a newline nor a space, which also allows to drop the empty list case.

Oh nice, didn't notice that being added

Python 2, 82 bytes
lambda*s:len(set(map(len,s)))<2<'!'<=min(tuple(s[0]+s[-1])+zip(*s)[0]+zip(*s)[-1])

Try it online!
Invoke as f("abcd", "e fg", "hijk").

MATL, 13 bytes
ctgF6Lt&()32>

Input is an array of strings, in the format {'abc' 'de'}.
Output is an array containing only ones, which is truthy, or an array containing at least a zero, which is falsey.
Try it online! Or verify all test cases, including truthiness/falsihood test.
Explanation
c       % Implicit input. Convert to char. This concatenates the
        % strings of the input cell array as rows of a rectangular
        % char array, right-padding with spaces as needed
tg      % Duplicate, convert to logical. Gives a logical array with
        % the same size containing true in all its entries
F       % Push false
6L      % Push the array [2, j-1], where j is the imaginary unit.
        % When used as an index, this is interpreted as 2:end-1
t       % Duplicate
&(      % Assignment indexing with 4 inputs: original array, new
        % value, two indexing arrays. This writes false at the inner
        % rectangle (2:end-1)×(2:end-1) of the logical array that
        % initially only contained true. This will be used as a
        % logical index (mask) into the rectangular char array
)       % Reference indexing. This selects the border of the char
        % array. The result is a column vector of chars
32>     % Is each entry greater than 32? (ASCII code for space)
        % Implicit display

11 bytes: cO6Lt&(32=~ Try it online! Just nulls out the non-border parts, then checks if there are any spaces.

@sundar Good idea! That's different enough, post it yourself

Nah, feels too similar to your answer, especially if I write it as cF6Lt&(32=~. Feel free to edit it in, or if not we can just leave it in the comments.

Canvas, 17 15 bytes
４［↷Ｋ；｝┐）｛ＳＬ］∑４≡

Try it here!
Explanation (ASCII-fied for monospace):
4[↷K;}┐){SL]∑4=  full program; pushes the input to the stack.
4[   }           repeat 4 times
  ↷                rotate ToS clockwise. This also pads the input with spaces
   K;              take off the last line and put it below the item
      ┐          pop the remaining of the input (the center)
       )         and wrap the rest (the sides) in an array
        {  ]     map over those
         S         split on spaces - should result to one item in the array
          L        and get the length
            ∑    sum those lengths together
             4=  check if equal 4

I find it ironic that these UTF8 characters in a monospace-like font give the feeling that there are many spaces in the source. (At least, they do in my browser.)

@Arnauld fullwidth characters do that. And that's why I made a font for my interpreter to make them prettier :p

JavaScript (ES6), 88 bytes
s=>!s.split`\n`.some((s,i,a)=>s[L='length']-a[0][L]|(++i%a[L]>1?/^\s|\s$/:/\s/).test(s))

Try it online!

Perl 5, 70 bytes
$f||=$_;$l||=y///c;$,||=/^\s|\s$/||$l-y///c;$e=$_}{$\="$f$e"=~/\s/||$,

Try it online!
Outputs 0 for truthy, any other number for falsey.

Red, 216 191 bytes
func[s][d:(length?(first(s:(split(s)"^/"))))sp:
func[a][none = find a" "]b: on foreach c s[b: b
and(d = length? c )and(c/1 <>" ")and(" "<> last
c)]res:(sp(first(s)))and(sp(last(s)))and(b)res]

Try it online!
I put a lot of otherwise not necessary parentheses in the first and last rows.

Jelly, 17 bytes
Ỵµ.ịÐ€;ịɗẎ⁶e<L€E$

Try it online!

@JonathanFrech Ah, fixed. >_>

@MagicOctopusUrn Huh? Can you please link to an input where this doesn't behave correctly?

Oh, no, you called mine out for the Does not seem to enforce equal line length too is all I was saying.

Doesn't seem to work for "  \n  " Try it online!

@Angs Try quoting it. It's apparently parsed as nothing if you put it like that.

Jelly, 15 bytes
Uses a method developed by Mnemonic in a (currently - due to an edge-case failure) deleted Pyth submission. (if it is now fixed up, go give some credit!)
ỴµL€Eȧt€⁶ZUƊ4¡⁼

A monadic link accepting a list of characters which returns 1 or 0.
Try it online!
How?
ỴµL€Eȧt€⁶ZUƊ4¡⁼ - Link: list of characters
Ỵ               - split at newlines (making a list of lists - the rows)
 µ              - start a new monadic chain, call that ROWS
  L€            - length of €ach row in ROWS
    E           - all equal? (an integer: 1 if so, otherwise 0)
            4¡  - repeat four times:
           Ɗ    -   last three links as a monad:
      t€⁶       -     trim spaces (⁶) from €ach row in current ROWS
         Z      -     transpose that result
          U     -     upend (reverse each new row)
     ȧ          - logical AND (0 if L€E was 0 else the result of the repeated transform)
              ⁼ - equal to X? (the integer 0 is not equal to any listy of characters)

@Mnemonic - Jelly-fied :)

Japt, 22 bytes
Noncompeting answer: there's a known bug in Japt, where two-dimensional array rotations truncate the results. Due to that bug the code below only works on inputs that are square. If the bug wasn't present, though, the code below should work completely correctly.
e_Ê¶UÌÊÃ©Ueº4o)r_z)mx}U
e_                      // Check if every line in the input array
  Ê¶UÌÊ                 // has the same length as the last item.
       Ã©               // Also,
               r_z)mx}U // check if rotating and trimming the input array
           º4o)         // four times
         Ue             // is equal to the input array.

Takes input as an array of strings. Using parentheses instead of spaces makes the rectangular code requirement quite easy.
Try it here.

C# (.NET Core), 145 167 bytes
S[0].Length>1&&S[0].IndexOf
(" ") + S[ S.Count() - 1 ].
IndexOf(" ")<-1&Array.Find(
S,x=>x[0]==' '| x [x.Length
-1]  ==  ' '  | S[0].Length
!=x.Length)==null?11>0:0>1;

Try it online!
S[0].Length>1&                                    // And if the lenght of the first argument is more than 1 char
Array.Find(                                       // Find a string in an array
    S,                                            // The array which will be searched in
    x=>                                           // For x as the current string from the array
    x.Length!=S[0].Length|                        // If the string lenght match not the first argument lenght
    x[0]==' '|                                    // Or if the string begins with a spacer
    x[x.Length-1]==' '                            // Or if the string ends with a spacer
)==null&                                          // And if there was no string found which matched the conditions
S[0].IndexOf(" ")+S[S.Count()-1].IndexOf(" ")<-1  // And if the first and last string doesn't have a spacer
?                                                 // If all above is true do
1>0                                               // Return True
:                                                 // Else
0>1                                               // Return False

No spaces in the first line.

@FrownyFrog S[0].IndexOf(" ") is searching for a space in the first line and S[S.Count()-1].IndexOf(" ") is searching in the last line. If there is no space in the first and last line, it is -2 which is then true at -2 < -1.

I mean the challenge, your code has the same restriction, so you can’t have spaces in the first line.

@FrownyFrog You mean the return ? Must I include it? Sry I'm new to Code Golf and I don't know the proper way of showing code on tio in C#. What must I do to get it right?

Your code must return True when passed to your program. It’s an additional restriction in this challenge.

@FrownyFrog it's returning true, C# compiles 1>0 to true and 0>1 to false. Through this way, I can save some bytes. Otherwise, it is case sensitive, then I must go with a string.

Let us continue this discussion in chat.

Ruby 2.5+, 63 bytes
->a{!a.uniq(&:size)[1]&&a.none?(/^\s|\s$/)&&!(a[0]+a[-1])[?\s]}

Takes input as an array of strings. No test link, since the version on TIO (2.4) is too old for this one. Instead, here is a slightly longer (69 bytes) version for testing:
->a{!a.uniq(&:size)[1]&&a.none?{|l|l=~/^\s|\s$/}&&!(a[0]+a[-1])[?\s]}

Try it online!
The difference is that since 2.5 Ruby supports directly passing a Regex pattern to all?, any?, none? methods, which saves us a few bytes. The method itself is quite self-explanatory - we test:

If there is only 1 unique line size
If there are any spaces on line boundaries
If there are spaces on the first and last lines.

C (gcc), 119 bytes
Takes input as a list (s) of n strings.
f(s,n,m,r,p)char**s,*p;{for(r=m=n;m--;r*=strlen(*s)==strlen(s[m])&(!p||m&&m^n-1&&p!=s[m]&&p[1]))p=strchr(s[m],32);n=r;}

Try it online!

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


text:
What's in my pasta sauce?
Background
In France, and probably in the rest of the European Union, any food available for sale must list the ingredients that compose it on its packaging, in weight percentage descending order. However, the exact percentage doesn't have to be indicated, unless the ingredient is highlighted by the text or an image on the covering.
For example, my basil tomato sauce, showing only some big red tomatoes and beautiful basil leaves on its packaging, has the following indications:

Ingredients: Tomatoes 80%, onions in pieces, basil 1.4%, sea salt, mashed garlic, raw cane sugar, extra virgin olive oil, black pepper.

It sounds savoury, but… how much onions will I eat, exactly?
Challenge
Given a list of weight percentages in descending order, eventually incomplete, output a complete list of the minimal and maximal weight percentages that can possibly be found in the recipe.

You can write either a function, or a full program.
The input can be in any reasonable form (array of numbers or list of strings, for instance). Fractional values should be supported at least to one decimal place. A missing weight percentage can be represented in any consistent and unambiguous way (0, '?' or null, for instance). You can assume that the input will always be associated to a valid recipe ([70] and [∅, ∅, 50] are invalid, for instance).
The output can be in any reasonable form (one array for both of the minimal and maximal weight percentages, or a single list of doublets, for instance). The minimal and maximal percentages can be in any order ([min, max] and [max, min] are both acceptable). Exact weight percentages don't need to be processed differently than other percentages and may be represented by equal minimal and maximal values.

Standard rules for code-golf apply: while you're typing your code, my pasta dish is cooling down, so the shortest submission wins.
Examples
Since this problem is harder than it may look at first glance, here is a step-by-step resolution of a few cases.
[40, ∅, ∅]
Let's call respectively x and y the two missing percentages.

Because it comes after the first ingredient at 40%, x can't be higher than 40 % itself.
[40, [?, 40], [?, ?]]
The sum of the two missing percentages is always 60%. Consequently :

If x takes its maximal value, then y takes its minimal value, which is therefore 60% - 40% = 20%.
[40, [?, 40], [20, ?]]
If x takes its minimal value, then y takes its maximal value. But x can't be lower than y, so in this case, x = y = 60% / 2 = 30%.
[40, [30, 40], [20, 30]]

[70, ∅, ∅, 5, ∅]
Let's call respectively x, y and z the three missing percentages.

The minimal and maximal percentages for z are necessarily between 0% and 5%. Let's assume z = 0% for a moment. The sum of the two missing percentages is always 25%. Consequently :
[70, [?, ?], [?, ?], 5, [0, 5]]

If y takes its minimal value, 5%, then x takes its maximal value, which is therefore 25% - 5% = 20%.
[70, [?, 20], [5, ?], 5, [0, 5]]
If y takes its maximal value, then x takes its minimal value. But x can't be lower than y, so in this case, x = y = 25% / 2 = 12.5%.
[70, [12.5, 20], [5, 12.5], 5, [0, 5]]

Let's verify that everything is fine if we assume now that z = 5%. The sum of the two missing percentages is always 20%. Consequently :

If y takes its minimal value, 5%, then x takes its maximal value, which is therefore 20% - 5% = 15%. This case is already included in the previously calculated ranges.
If y takes its maximal value, then x takes its minimal value. But x can't be lower than y, so in this case, x = y = 20% / 2 = 10%. This case is already included in the previously calculated range for y, but not for x.
[70, [10, 20], [5, 12.5], 5, [0, 5]]

Test cases
Input:  [∅]
Output: [100]

Input:  [70, 30]
Output: [70, 30]

Input:  [70, ∅, ∅]
Output: [70, [15, 30], [0, 15]]

Input:  [40, ∅, ∅]
Output: [40, [30, 40], [20, 30]]

Input:  [∅, ∅, 10]
Output: [[45, 80], [10, 45], 10]

Input:  [70, ∅, ∅, ∅]
Output: [70, [10, 30], [0, 15], [0, 10]]

Input:  [70, ∅, ∅, 5, ∅]
Output: [70, [10, 20], [5, 12.5], 5, [0, 5]]

Input:  [30, ∅, ∅, ∅, 10, ∅, ∅, 5, ∅, ∅]
Output: [30, [10, 25], [10, 17.5], [10, 15], 10, [5, 10], [5, 10], 5, [0, 5], [0, 5]]

Completely Unrelated

I would add a step-by-step explanation of input-to-output for [40, ∅, ∅] and [70, ∅, ∅, 5, ∅] to make things a bit more clearly. A challenge should be clear without looking at the test cases, which isn't the case right now. If I understand it correctly for [40, ∅, ∅]: 60 more is necessary for 100%, divided over these two ∅. The first ∅ has to be 30 or higher (otherwise the second ∅ will be above it, which shouldn't be possible when they are in order). In addition, it cannot be above 40, so the first ∅ becomes [30,40], and the second becomes [(100-40-40=)20, (100-40-30=)30].

Consistently [min,max]/[max,min] or mixed allowed?

@l4m2 Mixing [min,max] and [max,min] is borderline acceptable, but since it can't lead to ambiguous results, I'd say it's okay.

Maybe I'm missing something, but why does [70, 12, 11, 5, 2] not work for your second example? If it does work, the minimum for x would be less than 12.5.

@DLosc Yes, it does (the test case below is correct). I'm correcting that immediately ;).

I've been wanting to post this exact challenge for a year now. Do you have a lost identical twin by any chance? By the way, it's an EU thing: http://eur-lex.europa.eu/legal-content/EN/TXT/?uri=uriserv:OJ.C_.2017.393.01.0005.01.ENG&toc=OJ:C:2017:393:TOC

Can we stick with integers only in output? That would make bruteforce possible ;D

I'm close to a solution, yet still far away.. >.> Will try again next week, have to focus on work for now. Anyway, some more suggested test cases: [0, 0, 0, 0] -> [[25, 100], [0, 50], [0, 33.333], [0, 25]]; [40, 0, 0, 5, 0] -> [40, [25, 40], [10, 27.5], 5, [0, 5]] and [0, 25, 0, 10, 0, 5, 0] -> [[25, 45], 25, [10, 25], 10, [5, 10], 5, [0, 5]]. (Thanks @Arnauld for spotting a miscalculation.)

@Sanchises Given that I'm myself a PhD student in mechanical engineering, as you are, I'm seriously starting to question a lost twin, indeed ;-).

@DeadPossum Nope :-p. I've added this rule partly to avoid bruteforce de facto. Sorry !

I detest French cheese though....

@Sanchises == '"sans" cheese'

JavaScript (ES6), 252 bytes
Expects 0 for missing percentages. Returns a pair of minimum and maximum values for all entries.
a=>(g=a=>(h=(M,I,J=I^1)=>a.some((x,i)=>a.map((y,j)=>s-=j-i?M(j,i)-i?y[I]:M(w=y[I],z=x[J])-z||w==z?w:++k&&z:y[J],s=100,k=1,X=x)&&(I?-s:s)<0)?X[J]=M(X[I],X[J]+s/k):0)(Math.max,0)+h(Math.min,1)?g(a):a)(a.map((n,i)=>[n?p=n:a.find(n=>i--<0&&n)||0,p],p=100))

Try it online!
How?
Initialization
We first replace each value in the input array a[ ] with the largest possible range.
a.map((n, i) =>       // for each value n at position i in a[]:
  [                   //   generate a [min, max] array:
    n ?               //     if n is not 0:
      p = n           //       use n as the minimum and save it in p
    :                 //     else:
      a.find(n =>     //       find the first value n
        i-- < 0 &&    //         which is beyond the current value
        n             //         and is not equal to 0
      ) || 0,         //       or use 0 as a default value
    p                 //     use p as the maximum
  ],                  //   end of array declaration
  p = 100             //   start with p = 100
)                     // end of map()

Examples:
[ 0 ] --> [ [ 0, 100 ] ]
[ 30, 0, 5, 0 ] --> [ [ 30, 30 ], [ 5, 30 ], [ 5, 5 ], [ 0, 5 ] ]

Main function
The main function is h(). It looks for the first entry that appears to be inconsistent when we try to either minimize or maximize it. If it finds one, it updates it to a value which is at least temporarily acceptable, given the other ranges.
It takes as input either M = Math.max / I = 0 or M = Math.min / I = 1 and defines J as I XOR 1.
Because h() was written to support both the minimizing and maximizing passes, the code is a bit tricky to comment. That's why we will focus on the maximizing pass only, for which we have M = Math.max, I = 0 and J = 1. With these parameters, the code reads as follows:
a.some((x, i) =>              // for each range x at position i in a[] (tested range):
  a.map((y, j) =>             //   for each range y at position j in a[] (reference range):
    s -=                      //     update s:
      j - i ?                 //       if i is not equal to j:
        Math.max(j, i) - i ?  //         if j > i:
          y[0]                //           the reference range is beyond the tested range
                              //           so we just use the minimum value of the y range
        :                     //         else:
          Math.max(           //           take the maximum of:
            w = y[0],         //             w = minimum value of the y range
            z = x[1]          //             z = maximum value of the x range
          ) - z ||            //           if it's not equal to z
          w == z ?            //           or they are equal (i.e. if w <= z):
            w                 //             use w
          :                   //           else:
            ++k && z          //             increment the counter k and use z
      :                       //       else:
        y[1],                 //         use the maximum value of the y range
    s = 100,                  //     start with s = 100
    k = 1,                    //     start with k = 1
    X = x                     //     save the range x in X
  ) &&                        //   end of map()
  (0 ? -s : s) < 0            //   abort if s < 0 (i.e. if we've subtracted more than 100)
) ?                           // end of some(); if truthy:
  X[1] = Math.max(            //   update the maximum value of the faulty range to:
    X[0],                     //     either the minimum value
    X[1] + s / k              //     or the maximum value, less the correction
  )                           //   whichever is greater
:                             // else:
  0                           //   do nothing

Recursion
The recursive function g() keeps calling h() until neither the minimizing or the maximizing pass leads to a new correction, and eventually returns the final result.
g = a => h(Math.max, 0) + h(Math.min, 1) ? g(a) : a

Nicely done :-) !

@Blackhole Thanks! And BTW: my own pasta sauce reads [38,0,10,0,0,0,0,0,0,0].


text:
Weighted average - the pressup trend problem
Let's say that this array is how many press-ups I've achieved each day in the last 28 days:
[
  20,20,20,30,30,30,30,
  35,35,40,40,40,45,45,
  50,50,50,50,50,50,50,
  60,70,80,90,100,110,120
]

As you can see, it's taken a steep upward trend in the last week, and that's the part of this data I'm most interested in. The further in the past it is, the less I want that data to feature in my 'average' number of press-ups.
To that end, I want to work out an 'average' where each week is worth more than the previous week.

Background information, not part of this problem.
Normal average:
The sum of all values / the number of values
For above:
1440 / 28 = 51.42857142857143

Weighted average:
Split the array into 4 groups of 7, and start up a new array.

Add the first group to the array.
Add the second group to the array twice.
Add the third group to the array thrice.
Add the fourth group to the array four times.

Sum all of the new array, and divide by the length of the new array.
For above:
Convert the array to this:
[
  20,20,20,30,30,30,30, # first week once
  35,35,40,40,40,45,45,
  35,35,40,40,40,45,45, # second week twice
  50,50,50,50,50,50,50,
  50,50,50,50,50,50,50,
  50,50,50,50,50,50,50, # third week thrice
  60,70,80,90,100,110,120,
  60,70,80,90,100,110,120,
  60,70,80,90,100,110,120,
  60,70,80,90,100,110,120 # Fourth week four times
]

Then run a normal average on that array.
4310 / 70 = 61.57142857142857
Note that it's higher than the normal average value because of the upward trend in the last week.

The rules:

The input is a flat array of 28 nonnegative integers.
Any language you'd like to write in.
Output a number.
I always like to see TIO links.
Try to solve the problem in the smallest number of bytes.
The result should be a decimal accurate to at least 4 decimal places (either truncated or rounded up from the test case values is fine) or an exact fraction.

Test cases:
Case 1: Upward trend
[
  20,20,20,30,30,30,30,
  35,35,40,40,40,45,45,
  50,50,50,50,50,50,50,
  60,70,80,90,100,110,120
]

Normal average: 51.42857142857143
Weighted average: 61.57142857142857
Case 2: Leaving the lull behind
(I had a bad week, but it was a while ago)
[
  50,50,50,50,50,50,50,
  10,10,10,10,10,10,10,
  50,50,50,50,50,50,50,
  50,50,50,50,50,50,50
]

Normal average: 40
Weighted average: 42
Case 3: Giving up
I had a bad week, it's pulling my average down fast.
[
  50,50,50,50,50,50,50,
  50,50,50,50,50,50,50,
  50,50,50,50,50,50,50,
  10,10,10,10,10,10,10
]

Normal average: 40
Weighted average: 34
Case 4: Averaging out
Okay, so I'm just playing around here, I thought it might be the same value for the normal and weighted averages, but, of course, it was not.
[
  60,60,60,60,60,60,60,
  30,30,30,30,30,30,30,
  20,20,20,20,20,20,20,
  15,15,15,15,15,15,15
]

Normal average: 31.25
Weighted average: 24.0

Bonus problem:
What combination of 28 values would have the same normal average and weighted average?

Happy golfing!

Let us continue this discussion in chat.

You might want to try exponential smoothing too - new_avg = α*weekly_sum + (1-α)*old_avg for some α∈(0,1)

I do 0 press-ups every day, so my weighted average is the same as my normal average.

@Neil you would not benefit from the weighted average system ;)

be careful not to overtrain :p

I think the bonus question is trivial because you can just use the same value every day to get same average for both.  I don't think it adds anything to this challenge.

Husk, 6 bytes
AΣΣṫC7

Try it online!
Uses the trick Dennis used to outgolf my Jelly submission. Instead of repeating each chunk N times, it retrieves the suffixes of the list of chunks, which after flattening will yield the same result, except for the order.

Python 3, 38 bytes
lambda x:sum(x+x[7:]+x[14:]+x[21:])/70

Try it online!

05AB1E, 8 7 bytes
Saved 1 byte thanks to Mr. Xcoder
7ô.s˜ÅA

Try it online!
Explanation
7ô         # split list into groups of 7
  .s       # push suffixes
    ˜      # flatten
     ÅA    # arithmetic mean

@Mr.Xcoder: Oh yeah, I knew I had seen a mean function, but I couldn't find it :P

R+pryr, 32 28 bytes
and the same average score week over week would result in equality of the means.
pryr::f(s%*%rep(1:4,e=7)/70)

Try it online!
Saved 4 bytes by using dot product thanks to Giuseppe.
Pure R would have two more bytes using function

Of course it would, that's so obvious, now I think about it.

28 bytes using dot product instead of sum

I had 40 bytes with function(s)weighted.mean(s,rep(1:4,e=7))

@Giuseppe Luckily I did not remember weighted.mean. Love it when R outgolfs Python.

Jelly, 7 bytes
s7ṫJFÆm

Try it online!
How it works
s7ṫJFÆm  Main link. Argument: A (array of length 28)

s7       Split the array into chunks of length 7.
   J     Indices; yield [1, ..., 28].
  ṫ      Tail; yield the 1st, ..., 28th suffix of the result to the left.
         Starting with the 5th, the suffixes are empty arrays.
    F    Flatten the resulting 2D array.
     Æm  Take the arithmetic mean.

Huh, so x"J$ is equivalent to ṫJ in this context. Interesting!

Sort of. Instead of repeating the elements of the n-th array n times, this takes all suffixes. After flattening, it generates the same elements, but in a different order.

MATL, 10 bytes
7es4:*s70/

Try it online!
I haven't posted a MATL answer in ages! Figured I might participate as part of LOTM May 2018!
Explanation:
7e          % Reshape the array into 7 rows (each week is one column)
  s         % Sum each column
   4:       % Push [1 2 3 4]
     *      % Multiply each columnar sum by the corresponding element in [1 2 3 4]
      s     % Sum this array
       70/  % Divide by 70

I had K:7Y"*s70/ at 10 bytes as well.

Jelly, 9 bytes
s7x"J$FÆm

Try it online!
How it works

s7x"J$FÆm – Takes input from the first command line argument and outputs to STDOUT.
s7        – Split into groups of 7.
   "      – Apply vectorised (zipwith):
  x J$    – Repeat the elements of each list a number of times equal to the list's index.
      F   – Flatten.
       Æm – Arithmetic mean.

JavaScript (Node.js), 49 bytes
a=>a.map((x,i)=>(I+=d=-~(i/7),s+=x*d),s=I=0)&&s/I

Try it online!

Non generics solution
JavaScript (Node.js), 39 36 bytes
a=>a.reduce((s,x,i)=>s+x*-~(i/7))/70

Try it online!

-1 byte on the first solution using a=>a.reduce((s,x,i)=>(I+=d=-~(i/7),s+x*d),I=0)/I. And a quick tip: use <hr> to create a horizontal line in markdown

@HermanL What's wrong with using --- (needs its own paragraph)?

Haskell, 35 bytes
(/70).sum.zipWith(*)([1..]<*[1..7])

Bonus: if a,b,c,d are the weekly sums, normal average is the same as weighted average iff:
(a + b + c + d)/4 = (a + 2b + 3c + 4d)/10  <=>
10(a + b + c + d) = 4(a + 2b + 3c + 4d)    <=>
5(a + b + c + d)  = 2(a + 2b + 3c + 4d)    <=>
5a + 5b + 5c + 5d = 2a + 4b + 6c + 8d      <=>
3a + b - c - 3d   = 0

One solution is when first and last week have same sums, and likewise second and third weeks have the same sum, but there are infinitely many solutions if your biceps are up to it. Example: [15,10,10,10,10,10,5,20,20,20,25,25,20,20,30,20,20,20,20,20,20,10,10,20,0,10,10,10]
Try it online!

Stax, 10 8 bytes
äΔ6◙█µøΓ

Run and debug it
Explanation (unpacked):
7/4R:B$:V Full program, implicit input
7/        Split into parts of length 7
  4R      Push [1, 2, 3, 4]
    :B    Repeat each element the corresponding number of times
      $   Flatten
       :V Average

Another using Stax! Yes! You can use $ to flatten if the elements are all integers—checking with OP now.

Stax, 6 bytes
ñI"%"╟

Run and debug it at staxlang.xyz!
Unpacked (7 bytes) and explanation:
7/|]$:V
7/         Split into groups of seven.
  |]       Suffixes
    $:V    Flatten and average. Implicit print as fraction.

Japt, 11 10 bytes
xÈ/#F*ÒYz7

Try it

Explanation
 È             :Pass each element at index Y through a function
  /#F          :  Divide by 70
       Yz7     :  Floor divide Y by 7
      Ò        :  Negate the bitwise NOT of that to add 1
     *         :  Multiply both results
x               :Reduce by addition

Octave, 33 bytes
@(x)sum(reshape(x,7,4)*(1:4)')/70

Try it online!

K4 / K (oK), 19 16 14 bytes
Solution:
+/(1+&4#7)%70%

Try it online!
Example:
+/(1+&4#7)%70%50 50 50 50 50 50 50 10 10 10 10 10 10 10 50 50 50 50 50 50 50 50 50 50 50 50 50 50
42

Explanation:
Evaluation is perform right-to-left. Divide 7 1s, 7 2s, 7 3s and 7 4s by 70 divided by the input; then sum up.
+/(1+&4#7)%70% / the solution
           70% / 70 divided by the input
  (      )%    / the stuff in brackets divided by this...
      4#7      / draw from 7, 4 times => 7 7 7 7
     &         / 'where' builds 7 0s, 7 1s, 7 2s, 7 3s
   1+          / add one
+/             / sum (+) over (/) to get the total

Charcoal, 14 bytes
Ｉ∕ΣＥ⪪Ａ⁷×Σι⊕κ⁷⁰

Try it online! Link is to verbose version of code. Explanation:
     Ａ          Input array
    ⪪ ⁷         Split into subarrays of length 7
   Ｅ            Loop over each subarray
         ι      Subarray
        Σ       Sum
           κ    Loop index
          ⊕     Incremented
       ×        Product
  Σ             Sum results
            ⁷⁰  Literal 70
 ∕              Divide
Ｉ               Cast to string
                Implicitly print

Excel: 33 bytes
(3 bytes saved from @wernisch's answer by running data on 2 lines from A1:N1 and A2:N2)
=AVERAGE(A1:N2,H1:N2,A2:N2,H2:N2)

Apologies for not including this as a comment. I don't have enough reputation to do so.

Arturo, 40 bytes
$[a][i:0(sum map a'x[x*1+i/7i:i+1])//70]

Try it

APL+WIN, 13 bytes
Prompts for array as a vector of integers:
(+/⎕×7/⍳4)÷70

Explanation:
7/⍳4) create a vector comprising 7 1s, 7 2s, 7 3s and 7 4s

+/⎕× prompt for input, multiply by the vector above and sum result

(....)÷70 divide the above sum by 70

Triangularity, 49 bytes
....)....
...D7)...
..14)21..
.WM)IEtu.
}u)70s/..

Try it online!
Explanation
)D7)14)21WM)IEtu}u)70s/ – Full program.
)D7)14)21               – Push the literals 0, 7, 14, 21 onto the stack.
         WM     }       – Wrap the stack to a list and run each element on a separate
                          stack, collecting the results in a list.
           )IEt         – Crop the elements of the input before those indices.
               u        – Sum that list.
                 u      – Then sum the list of sums.
                  )70   – Push the literal 70 onto the stack.
                     s/ – Swap and divide.

Perl 5 -pa, 28 bytes
$\+=$_/70*int$i++/7+1for@F}{

Try it online!
Input is space separated rather than comma separated.

You have $. available as the perfect multiplier. No need for $i

Java 8, 57 bytes
a->{int r=0,i=35;for(;i-->7;)r+=i/7*a[i-7];return r/70d;}

Try it online.
Explanation:
a->{              // Method with integer-array parameter and double return-type
  int r=0,        //  Result-sum, starting at 0
      i=35;       //  Index-integer, starting at 35
  for(;i-->7;)    //  Loop `i` downwards in the range (35,7]
    r+=           //   Add the following to the result-sum:
       i/7        //    `i` integer-divided by 7,
       *a[i-7];   //    multiplied by the item at index `i-7`
  return r/70d;}  //  Return the result-sum, divided by 70.0

Clojure, 48 46 bytes
#(/(apply +(for[i[0 7 14 21]v(drop i %)]v))70)

This ended up being shorter than mapcat + subvec combination.

J, 16 bytes
70%~1#.]*7#4{.#\

Explanation:
              #\           finds the lengths of all successive prefixes (1 2 3 4 ... 28)
           4{.             takes the first 4 items (1 2 3 4)
         7#                creates 7 copies of each element of the above list
       ]*                  multiplies the input by the above
    1#.                    sum
70%~                       divide by 70

Try it online!

Excel, 36 33 bytes
-3 bytes thanks to @tsh.
=SUM(1:1,H1:AB1,O1:AB1,V1:AB1)/70

Input in first row (A1 to AB1).

Maybe A1:AB1 -> 1:1?

TI-Basic, 25 bytes
mean(Ansseq(sum(I>{0,7,21,42}),I,1,70

Alternate solution, 39 bytes
Input L1
For(I,1,70
Ans+L1(I)sum(I>{0,7,21,42
End
Ans/70

Ruby, 65 bytes
->r{(b=(0..r.size/7).map{|a|r[a*7..-1]}.flatten).sum/b.size.to_f}

Try it online!

The input size is specified to be fixed at 28 here - so you can save several bytes by hardcoding the values instead of using the size property. Try it online!

Julia 0.6, 27 bytes
p->repeat(1:4,inner=7)'p/70

Try it online!
The repeat call forms a column matrix of 28 values, containing seven 1's, then seven 2's, etc. We then transpose it with ', then do a matrix multiplication with the input (mutiplication is implicit here). Since it's a matrix multiplication of a 1x28 matrix with a 28x1 matrix, we end up with a single value, which is the weighted sum we need. Divide that by 70 to get our weighted mean.

Factor + math.unicode, 36 bytes
[ [ 7 /i 1 + * ] map-index Σ 70 / ]

Try it online!


text:
Can You Spell This Word With These Dice?
Letter dice are common in word games. It can be fun to try to spell funny words with boggle dice, for instance. If you grab a handful of dice, chances are you won't be able to spell certain words. This challenge is a generalization of that idea.
Challenge
Given a list of dice which each have at least 1 face and a word, your task is to determine if it is possible to spell that word using the given dice (in which case, it should return a truthy result). Only one letter from each die can be used and a die can be used only once. You do not need to use all of the given dice.
Examples
In a trivial example, with the dice [[A], [C], [T]] and the string CAT, the result is true. BAT would, of course, return false since there are no dice with B on them
If given [[A, E, I, O, U], [A, B, C, T], [N, P, R]] as the set of dice, you would return true for ART, TON, and CUR, but false for CAT, EAT, and PAN because those strings require reusing dice. It should also be fairly obvious that CRAB cannot be spelled with these dice since there are not enough dice.
If given [[A, B, C], [A, E, I], [E, O, U], [L, N, R, S, T]] as the set of dice, you would be able to spell CAT, BEE, BEAN, TEA, BEET, and BAN, but you would not be able to spell LONE, CAB, BAIL, TAIL, BAA, or TON
There may be multiples of the same die. If given [[A, B, C], [A, B, C], [A, B, C]], you would be able to spell CAB, BAA, AAA, etc... but obviously nothing without A, B, or C in it.
Rules

No exploiting standard loopholes
This is code-golf, so the shortest code wins.
You may assume that both words and dice will only be made up of capital letters.
You may assume that the word will always be at least 1 letter long and that there will always be at least 1 die.
You may assume that a die will never have more than one of the same letter.
Input and output may be in any convenient format.

Why making new tags?

Can one take a list (vector) of chars as input (similar format as a dice)? Asking for a friend who'd like to save 27 bytes.

@JayCe "Input and output may be in any convenient format", so yes.

Brachylog, 5 bytes
∋ᵐ⊇pc

Try it online!
We use the input variable for the dice and the output variable for the word. It outputs true. when it's possible to spell the word and false. otherwise.
Explanation
∋ᵐ        Map element: Take one side from each die
  ⊇       Subset
   p      Permute
    c     Concatenate into a string: will only succeed if it results in the output word

Haskell, 48 44 bytes
import Data.List
(.mapM id).any.(null.).(\\)

This is an anonymous function. Bound to some identifier f it can be used as f "ART" ["AEIOU", "ABCT", "NPR"], which yields True. Try it online!
The non-point-free equivalent is
f word dice = any(\s -> null $ word\\s) $ mapM id dice

mapM id over a list of lists uses the Monad instance of list and can be seen as non-deterministic choice. Thus e.g. mapM id ["AB","123"] yields ["A1","A2","A3","B1","B2","B3"].
For each of those dice combinations, we check if the list difference (\\) of the given word and the combination yields an empty list.

@LuisMendo Thanks for pointing out! Fixed by switching to another method which ended up saving 4 bytes.

Python 2, 82 bytes
f=lambda d,w:w==''or any(w[0]in x>0<f(d[:i]+d[i+1:],w[1:])for i,x in enumerate(d))

Try it online!
f=lambda d,w:w==''                                                                 # Base case: we can spell '' with any dice.
                  or any(                                 for i,x in enumerate(d)) # Otherwise, we check if there is some die x such that...
                         w[0]in x                                                  # the first letter is on this die,
                                 >0<                                               # and
                                    f(d[:i]+d[i+1:],w[1:])                         # we can spell the rest of the word with the rest of the dice.

The comparison chain w[0]in x>0<f(...) is equivalent to: w[0]in x and x>0 and 0<f(...).
The second of those is always true (str > int) and the third of those is equivalent to f(...), so that the whole thing is a shorter way to write w[0]in x and f(...)

JavaScript (ES6), 68 bytes

f=([c,...w],a)=>!c||a.some((d,i)=>d.match(c)&&f(w,a.filter(_=>i--)))
<div oninput=o.textContent=f(i.value,d.value.split`\n`)>
<textarea id=d rows=9>
ABC
AEI
EOU
LNRST
</textarea>

<input id=i value=BEAN>

true

@RickHitchcock Fails for EEE.

JavaScript (ES6), 74 bytes
Takes input in currying syntax (w)(a), where w is the word we're looking for and a is a list of strings describing the dice. Returns 0 or 1.
w=>P=(a,m='')=>w.match(m)==w|a.some((w,i)=>P(a.filter(_=>i--),m+`[${w}]`))

Try it online!
Commented
We turn each subset-permutation of the dice into a regular expression pattern and test them against the target word.
w =>                        // w = target word
  P =                       // P = recursive function taking:
    (a,                     //   a[] = list of dice
        m = '') =>          //   m   = search pattern
    w.match(m) == w |       // force a truthy result if w matches m
    a.some((w, i) =>        // for each word w at position i in a[]:
      P(                    //   do a recursive call:
        a.filter(_ => i--), //     using a copy of a[] without the current element
        m + `[${w}]`        //     and adding '[w]' to the search pattern
      )                     //   end of recursive call
    )                       // end of some()

Husk, 5 bytes
~V`¦Π

Try it online!
Returns a non-zero value if it's possible to spell the word, zero otherwise.
Explanation
~V`¦Π  Arguments: word [Char], dice [[Char]]
 V     Checks if any element of a list (2) satisfies a predicate (1)
~      Composes both arguments of the above function
  `¦     (1) Is the word a subset of the element?
    Π    (2) Cartesian product of the dice list

Perl 5 -plF, 48 46 bytes
@DomHastings saved 2 bytes
$_=grep/@{[sort@F]}/,map"@{[sort/./g]}",glob<>

Try it online!
Input:
word               # The word to validate
{A,B,C}{D,E,F}     # Each die is surrounded by braces, commas between the letters

Output:
0 for a word that is not validated.  Any positive integer for a word that is validated
How?
This explanation looks at the code in the order of execution, effectively right-to-left for this one-liner.
-F             # The first line of input is automatically split by the -F command option into the @F array.
glob<>         # Read the rest of the input and enumerate all of the permutations of it
map"@{[sort/./g]}",  # Split the permutation into separate letters, sort them and put them back together
/@{[sort@F]}/, # use the sorted letters of the target to match against
$_=grep        # check all of those permutations to see if the desired word is in them
-p             # Command line option to output the contents of $_ at the end

JavaScript (Node.js), 98 bytes
f=(s,d,u=[])=>d<1?s.every(t=>u.pop().match(t)):d.some((x,i)=>f(s,e=[...d],[...u,x],e.splice(i,1)))

Try it online!
Assuming there's enough dice
JavaScript (Node.js), 100 bytes
f=(s,d,u=[''])=>d<1?s.every(t=>u.pop().match(t)):d.some((x,i)=>f(s,e=[...d],[...u,x],e.splice(i,1)))

Try it online!
JavaScript (Node.js), 99 bytes
s=>f=(d,u=[''])=>d<1?s.every(t=>u.pop().match(t)):d.some((x,i)=>f(e=[...d],[...u,x],e.splice(i,1)))

Try it online!

Jelly,  10  9 bytes
-1 thanks to Erik the Outgolfer (use w rather than ẇ@ >.<)
Œ!Œp€Ẏw€Ṁ

A dyadic link accepting a list of lists of characters on the left (the dice) and
a list of characters on the right (the word) which returns 1 if possible and 0 if not.
Try it online! Or see the test-suite.
How?
Œ!Œp€Ẏw€Ẹ - Link: list of lists of characters Dice, list of characters Word
Œ!        - all permutations of the dice (i.e. all ways to order the dice)
  Œp€     - Cartesian product of €ach (i.e. all ways to roll each ordering)
     Ẏ    - tighten (i.e. all ordered ways to roll the dice)
       €  - for each:
      w   -   first index (of sublist W) in the result (positive if there, 0 otherwise)
        Ẹ - any truthy? (1 if it is possible to roll the word, 0 otherwise)

Faster algorithm (also 9 bytes):
A dyadic link with the same input format which returns positive integer (truthy) when possible and 0 (falsey) otherwise.
Œpf€Ṣ€ċṢ} - Link: list of lists of characters Dice, list of characters Word
Œp        - Cartesian product of the dice (all rolls of the dice)
  f€      - filter keep for €ach (keep the rolled letters if they are in the word)
    Ṣ€    - sort €ach result
       Ṣ} - sort Word
      ċ   - count occurrences

R, 192 185 135 117 111 109 bytes
function(x,...)s(x)%in%apply(expand.grid(lapply(list(...),c,"")),1,s)
s=function(x)paste(sort(x),collapse="")

Try it online!
-2 chars thanks to Giuseppe.

This will fail if a word has fewer letters than you have dice.

I think you can save it at the cost of 21 bytes, try it here

@Giuseppe You saved the day!

you don't need the F=

Vyxal, 8 bytes
ṖvÞ*Þf$c

Try it Online!
Returns 1 for valid, 0 for invalid.
Ṗv  Þf   # over all permutations
  Þ*     # Reduce by cartesian product
      $c # Check if the input contains that

Pyth, 21 bytes
.Em}eQdsm.ps.nd.U*bZh

Test suite
Explanation:
.Em}eQdsm.ps.nd.U*bZhQ # Code with implicit variables
.E                     # Print whether any of
       sm.ps  d        # all positive length permutations of each element in
        m   .nd.U*bZhQ # the Cartesian product of the list of dice
  m}eQd                # contain the target word

Ruby, 54 bytes
->w,a{a.permutation.any?{/#{w.chars*".*,.*"}/=~_1*?,}}

Attempt This Online!