text:
Decode the chmod
Challenge
Given a three digit octal permissions number, output the permissions that it grants.
chmod
On UNIX OSes file permissions are changed using the chmod command. There are few different ways of using chmod, but the one we will focus on today is using octal permissions.
The three digits in the permissions number represent a different person:

The first digit represents the permissions for the user
The second digit represents the permissions for the group
The last digit represents the permissions for others

Next, each digit represents a permission as shown below in:
Key: number | permission

7 | Read Write and Execute
6 | Read and Write
5 | Read and Execute
4 | Read only
3 | Write and Execute
2 | Write only
1 | Execute only
0 | None

Input
The input will be the three digit number as a string, e.g.:
133

or
007

This will be passed either via STDIN or via function arguments.
Output
Your output should be the different permissions for each of the user, the group and the others. You must display this information like so:
User:   ddd
Group:  ddd
Others: ddd

Where there are three spaces after User, two spaces after Group and one space after Others. You replace ddd with the permissions information.
Your output may be to STDOUT or as a returned string.
Examples
Input: 666
Output:
User:   Read and Write
Group:  Read and Write
Others: Read and Write

Input: 042
Output:
User:   None
Group:  Read only
Others: Write only

Input: 644
Output:
User:   Read and Write
Group:  Read only
Others: Read only

Winning
The shortest code in bytes wins.

What are the specifications of the input?

@JonathanAllan Just the three digit number

You mean as a decimal integer only, so 042 would be received as 42?

@Jonathan No, it's a string input so it'd be 042

Are we allowed to have an int-array or three ints as input? Or we need to use the String and then parse to digits?

@KevinCruijssen You need to have a string and parse the digits

Is using a tab instead of [3|2|1] spaces allowed?

@aross No, you must use spaces since all of the answers have used spaces

@BetaDecay Except the PHP one :)

@aross Oh right haha

The top JavaScript entry currently also uses a tab at time of writing.

The output looks right with a tab character, so why not use it? Just to penal languages that need more bytes to pad a string?

@Titus No, because I specified to use spaces, which almost every other submission does

05AB1E, 89 87 bytes
”‚Ý:‚Ù:ˆ†:”ð¡v”Šª0ÍÃ20‡í20‡í1ÍÃ0‚Ø20‚Ø1ÍÃ0‚Ø1‡í0‚Ø‡í1ÍÃ”2ð'€É«:1ð'€ƒ«:0ð«¡¹Nèèð3N-×ìyì,

Summons the Cthulhu encoding. Uses the CP-1252 encoding. Try it online!

Javascript (ES6), 165 161 bytes
n=>[0,1,2].map(i=>(s='User:  3Group: 68Others:58None576Read48Write476Execute475and4576only'.split(/(\d+)/))[i*2]+s[n[i]*2+1].replace(/./g,c=>' '+s[c*2])).join`
`

Edit: +1 byte to fulfill the "no tab" rule
Examples

let f =
n=>[0,1,2].map(i=>(s='User:  3Group: 68Others:58None576Read48Write476Execute475and4576only'.split(/(\d+)/))[i*2]+s[n[i]*2+1].replace(/./g,c=>' '+s[c*2])).join`
`
console.log(f("666"));
console.log(f("042"));
console.log(f("644"));
console.log(f("137"));

You can gain a few bytes by rearranging the array (and maybe separating the numbers from the strings). +1 for the idea.

@Titus - I've to admit that I fail to see a rearrangement that saves some bytes. Also, the numbers have to be treated as strings so that replace() works on them without coercing. But I may be missing your point.

@Titus - Something like 'User3Group68Others58None576Read48Write476Execute475and4576only'.split(/(\d+)/) might work. Is that what you had in mind?

I was misunderstanding them; thought they were octal values. :) But your new idea is not bad either.

Challenge output requires spaces instead of tabs as it is currently written.

@Mwr247 - This is apparently still under discussion, but I did the update anyway (+1 byte).

GNU sed, 187 163 158 (157+1) bytes
Run with -r (ERE regexp). File contains no trailing newline.
s/(.)(.)/User:   \1\nGroup:  \2\nOthers: /g
s/[4-7]/Read &/g
s/[2367]/Write &/g
s/[1357]/Execute &/g
s/(\w) (\w+) [1-7]/\1 and \2/g
s/[1-7]/only/g
s/0/None/g

Nice approach but you can save about 20 bytes by removing the digits when you add the and or only.

@Neil there :) incorporated your suggestion for a very significant save.

The first line could be just: s/(.)(.)/User:   \1\nGroup:  \2\nOthers: /. Some more bytes could be saved by porting to Perl, which has \d and \K.

@ninjalj good point. I'll stick to sed since I don't know Perl, and I'm sure there'd be other tricks to pull there to make it even shorter, outside of s/// replacements.

In the 3-last substitution, you can use a word boundary and the multiline flag to save some bytes.

Jelly, 100 91 85 bytes
Almost certainly golfable - 91 bytes, what?! 8 months and 6 wisdom bytes!
- 1. more string compression;
- 2. remove the post-ordinal decrement by 48 since indexing is modular;
- 3. use better tacit chaining).
-9 bytes with the kind help of @Lynn running string compressions for me
,“£ɱ~»
Ñ
ṖK,“ and”,Ṫ
LĿK
7RBUT€Uị“ØJƓ“¥Ị£“¤/¡»Ç€“¡*g»ṭ
“ṖŒhJ"ỵd¡»ḲðJ4_⁶ẋ⁸,"j€”:ż⁹Oị¢¤Y

Test it at TryItOnline
How?
,“£ɱ~» - Link 1: pair with the string "Only"

Ñ - Link 2: call next link

ṖK,“ and”,Ṫ - Link 3: insert " and" between the last two elements of x
Ṗ           - x[:-1]
 K          - join with spaces
   “ and”   - the string " and"
          Ṫ - x[-1]
  ,      ,  - pair

LĿK - Link 4: call appropriate link and add missing spaces
L   - length
 Ŀ  - call link at that index
  K - join the result with spaces

7RBUT€Uị“ØJƓ“¥Ị£“¤/¡»Ç€“¡*g»ṭ - Link 5: construct all 8 cases
7R                            - range of 7: [1,2,3,4,5,6,7]
  B                           - binary (vectorises): [[1],[1,0],[1,1],[1,0,0],[1,0,1],[1,1,0],[1,1,1]]
   U                          - reverse (vectorises): [[1],[0,1],[1,1],[0,0,1],[1,0,1],[0,1,1],[1,1,1]]
    T€                        - indexes of truthy values for each: [[1],[2],[1,2],[3],[1,3],[2,3],[1,2,3]]
      U                       - reverse (vectorises): [[1],[2],[2,1],[3],[3, 1],[3,2],[3,2,1]]
        “ØJƓ“¥Ị£“¤/¡»         - list of strings: ["Execute","Write","Read"]
       ị                      - item at index (vectorises): [["Execute"],["Write"],["Write","Execute"],["Read"],["Read","Execute",["Read","Write"],["Read","Write","Execute"]]
                     Ç€       - call the previous link for each
                       “¡*g»  - the string "None"
                            ṭ - tack (Jelly is 1-based so the 8th item will be indexed as 0)

“ṖŒhJ"ỵd¡»ḲðJṚ⁶ẋ⁸,"j€”:ż⁹Oị¢¤Y - Main Link: parse input and make the result. e.g.: "042"
“ṖŒhJ"ỵd¡»                     - dictionary compression of "User Group Others"
          Ḳ                    - split at spaces -> ["User","Group","Others"]
           ð                   - dyadic chain separation, call that g (input as right)
            J                  - range of length of g -> [1,2,3]
             Ṛ                 - reverse -> [3,2,1]
              ⁶                - literal space
               ẋ               - repeat -> ["   ","  "," "]
                ⁸              - chain's left argument, g
                  "            - zip with:
                 ,             -   pair -> [["User","   "],["Group","  "],["Others"," "]]
                     ”:        - literal ':'
                   j€          - join for €ach -> ["User:   ","Group:  ","Others: "]
                            ¤  - nilad followed by link(s) as a nilad:
                        ⁹      - chain's right argument, the input string -> "042"
                         O     -   cast to ordinal (vectorises) -> [48, 52, 50]
                           ¢   -   call last link (5) as a nilad  -> ["Execute Only","Write Only","Write and Execute","Read Only","Read and Execute","Read and Write","Read Write and Execute","None"]
                          ị    -   index into (1-based & modular) -> ["None","Read Only","Write Only"]
                       ż       - zip together -> [["User:   ","None"],["Group:  ","Read Only"],["Others: ","Write Only"]]
                             Y - join with line feeds -> ["User:   ","None",'\n',"Group:  ","Read Only",'\n',"Others: ","Write Only"]
                               - implicit print:
                                             >>>User:   None
                                             >>>Group:  Read Only
                                             >>>Others: Write Only

C# 214 Bytes
string h(string y){string e="Execute ",r="Read ",w="Write ",O="Only",a="and ";var z=new[]{"None",e+O,w+O,w+a+e,r+O,r+a+e,r+a+w,r+w+a+e};return$"User:   {z[y[0]-'0']}\nGroup:  {z[y[1]-'0']}\nOthers: {z[y[2]-'0']}";}

Octave, 185 bytes
@(n)fprintf('User:   %s\nGroup:  %s\nOthers: %s',{'Read Write and Execute','Read and Write','Read and Execute','Read only','Write and Execute','Write only','Execute only','None'}{56-n})

Create anonymous function that takes the input as a string: '042'. Convert it to an array: (56-'042)' = [0 4 2]. Use this as multiple cell indices to index the cell array with Read Write and Execute','Read and Write', .... Uses fprintf to output the three strings, with the appropriate categories: User:   , Group:   and Others: .
I tried finding a way to store Execute, Write, Read as separate words and concatenate as needed, but this turned out longer than the naive approach.
Examples:
1> f('000')
User:   None
Group:  None
Others: None
2> f('042')
User:   None
Group:  Read only
Others: Write only

Try it online.

You can save a few bytes using strsplit('Read Write and Execute*Read and Write*Read and Execute*Read only*Write and Execute*Write only*Execute only*None','*') instead of the cell array literal

PowerShell v2+, 189 168 bytes
[char[]]$args[0]|%{('User','Group','Others')[$i++]+":`t"+('None','Read','Write','Execute','only','and')[(0,(3,4),(2,4),(2,5,3),(1,4),(1,5,3),(1,5,2),(1,2,5,3))[$_-48]]}

Loops through the input $args[0] as a char-array. Each iteration, we index into an array with $i++ (defaults to 0) to select User, Group, or Others, concatenate that with a colon and a tab, and concatenate that with another array index.
Here's the magic. We implicitly cast the char to an int and subtract 48 (i.e., turning ASCII 48 ("0") into 0), choosing the appropriate wording as an array of ints. That array is subsequently used as the index into the 'None','Read','Write','Execute','only','and' array. Since the default $ofs (Output Field Separator) is a space, this correctly inserts spaces between the array elements when stringified (which happens when it concatenates to the left).
These three strings are left on the pipeline, and output via implicit Write-Output happens at program completion.
Example
PS C:\Tools\Scripts\golfing> .\decode-the-chmod.ps1 '123'
User:   Execute only
Group:  Write only
Others: Write and Execute

Straw, 193 bytes
((01234567)((None)(Execute only)(Write only)(Write and Execute)(Read only)(Read and Execute)(Read and Write)(Read Write and Execute)))::~<:{-¢(User:   ),+>
>}:{-¢(Group:  ),+>
>}-¢(Others: ),+>

Try it online
Push 3 times a conversion table on the first stack, switch to the second stack, convert each number using the conversation table and print.

PHP, 169 159 bytes
foreach([User,Group,Others]as$i=>$u){echo"
$u: ";for($n=[5,33,34,66,35,67,131,531][$i]];$n;$n>>=3)echo["and",Execute,Write,Read,only,None][$n&7]," ";}

takes string as command line argument: php -r '<code>' <argument>,
prints a leading newline instead of a trailing one
Thanks to Jörg for pointing out my bugs - and for the \t.
PHP, 169 bytes
with the new restriction: (tab character forbidden)
foreach(['User:  ','Group: ','Others:']as$i=>$u){echo"
$u";for($n=[5,33,34,66,35,67,131,531][$argv[1][$i]];$n;$n>>=3)echo' ',['and',Read,Write,Execute,only,None][$n&7];}

This is 1 byte shorter than with str_pad, because of the additional blank it would require.
breakdown
foreach([User,Group,Others]as$i=>$u)
{
    echo"\n$u:\t";                      // print newline, who, blanks
    for($n=[5,33,34,66,35,67,131,531]   // octal values for words indexes
        [$argv[1][$i]]                  // (last word=highest digit)
        ;$n;$n>>=3)                     // while value has bits left
        echo['and',Execute,Write,Read,only,None][$n&7]," "; // print that word
}

To create the array for $n, use this:
$b=[[5],[1,4],[2,4],[2,0,1],[3,4],[3,0,1],[3,0,2],[3,2,0,1]];
foreach($b as$i=>$a){for($v=$j=0;$a;$j+=3)$v+=array_shift($a)<<$j;echo"$v,";}

foreach(['User','Group','Others']as$i=>$u){echo"\n$u:\t"; saves some bytes and the output for 3,4,6 is wrong

This is the right order [5,33,34,66,35,67,131,531] nice idea

I have forget 'User' to User for exmple saves the next 6 Bytes you want to beat JavaScript do it

@JörgHülsermann: I was about to adopt the "\t" anyway; thanks. +1 for that :) Good eye on the 33!

for 346 our output is User: Read and Write
Group: Execute only
Others: Write and Execute it should User: Write and Execute
Group: Read Only
Others: Read and Write

@JörgHülsermann: Fixed. These are the correct values: [5,33,34,66,35,67,131,531]

How exactly are you supposed to pass the argument? Your golfed version seems to be incorrect

No using of tabs either

Dear downvoter: why?

Haskell, 186 Bytes
s=zip(words"7654 6 7632 753 7531 0 421")(words"Read and Write and Execute None only")
m c=mapM_(\(x,y)->putStrLn(x++unwords[b|(a,b)<-s,elem y a]))$zip["User:   ","Group:  ","Others: "]c

Example:
Prelude> :r
[1 of 1] Compiling Main             ( decCh.hs, interpreted )
Ok, modules loaded: Main.
*Main> m "654"
User:   Read and Write
Group:  Read and Execute
Others: Read only

Only Prelude used. Am I doing this right?
Ungolfed:
s = zip (words "7654 6 7632 753 7531 0 421")
        (words "Read and Write and Execute None only")

ps y = unwords [b|(a,b)<-s,elem y a] -- build permissions string
pp (x,y) = putStrLn $ x ++ ps y -- print user + permission

m c =   let up = zip ["User:   ","Group:  ","Others: "] c -- pair user and permission
        in mapM_ pp up --print each

bash - 221 213 bytes
GNU bash, version 4.3.46
l=("User:   " "Group:  " "Others: ")
o=\ only;a=" and ";x=Execute;w=Write;r=Read
b=(None "$x$o" "$w$o" "$w$a$x" "$r$o" "$r$a$x" "$r$a$w" "$r $w$a$x")
for c in `echo $1|grep -o .`;{ echo "${l[$((z++))]}${b[$c]}";}

Unclear if this can be condensed any further, at least not without fundamentally changing the approach here (splitting up input and using it as an index to the array ${b} that holds the corresponding strings).

It's shorter with \ only expanded inline. grep -o .<<<$1 is shorter than echo $1|grep -o ., but reading the input from stdin with while read -n1 c is better. Array indexes have arithmethic context in bash, so ${l[z++]} works. l would be shorter as a string, which would be accessed as ${l:z++*8:8} (offset and length have arithmethic context). Another byte can be sh?aved by reading the whole mode in c, expanding "User:   ", ... inline and making judicious use of parameter expansions.

For an end result of: a=" and ";x=Execute;w=Write;r=Read;b=(None $x\ only $w\ only "$w$a$x" $r\ only "$r$a$x" "$r$a$w" "$r $w$a$x");read c;echo "User:   ${b[${c%??}]}\nGroup:  ${b[${c:1:1}]}\nOthers: ${b[${c:2}]}" (replace \n with literal newlines).

Python 2, 190 185 bytes
def f(i):
 r,w,a,x,o,g="Read ","Write ","and ","Execute ","only",["User:  ","Group: ","Others:"];p=["None",x+o,w+o,w+a+x,r+o,r+a+x,r+a+w,r+w+a+x]
 for z in 0,1,2:print g[z],p[int(i[z])]

Leaves a trailing space if Execute or Write are at the end of the line but I didn't see that this wasn't allowed.
EDIT Saved 5 bytes by changing range(3) to 0,1,2 and checking byte count on my Linux laptop instead of my Windows one (\n = \r\n or the other way round. I can never remember which).

Python 2, 240 239 238 237 228 bytes
I thought I’d finally give this cold golf thing a go. Hopefully trailing whitespace is allowed. (fixed, and in the process saved a byte)
i=0
def a(b):
 for d in 4,2,1:
    if b&d:yield('Execute','Write','Read')[d/2]
for k in raw_input():
 b,q=list(a(int(k))),' and';e=len(b)
 if e:b[~e/2]+=(' only',q,q)[e-1]
 print'UGOsrteohrue:pr :s  :'[i::3],' '.join(b)or None;i+=1

Welcome to PPCG, and nice first answer!

I have shamelessly replaced the range(3) in my Python 2 answer to 0,1,2 after reading through your code. Nice answer. +1

Javascript, 213 209 208 188 186 bytes
function(d){a=" and ";r="Read";w="Write";e="Execute";v=";";o=" only";c=["None",e+o,w+o,w+a+e,r+o,r+a+e,r+a+w,r+" "+w+a+e];return"User: "+c[d[0]]+"\nGroup: "+c[d[1]]+"\nOthers: "+c[d[2]]}

Saved 20 bytes thanks to Dada!

I might be mistaken, but shouldn't your array be in the opposite order? If I call b("000"), it returns "Read Write and Execute" while one could expect "None"...

And I'm pretty sure this could be more golfed. For instance, a 191 byte version : function b(p){a=" and ";r="Read";w="Write";e="Execute";v=";";o=" only";c=["None",e+o,w+o,w+a+e,r+o,r+a+e,r+a+w,r+" "+w+a+e];return"User:   "+c[p[0]]+"\nGroup:  "+c[p[1]]+"\nOthers: "+c[p[2]]}.

Groovy, 217 207 205 bytes
def c(m){def i=0,e='Execute',w='Write',r='Read',o=' only',a=' and ';m.each{println(['User:   ','Group:  ','Others: '][i++]+['None',"$e$o","$w$o","$w$a$e","$r$o","$r$a$e","$r$a$w","$r $w$a$e"][it as int])}}

ungolfed:
def c(m) {
  def i=0,e='Execute',w='Write',r='Read',o=' only',a=' and ';
  m.each{
    println(['User:   ','Group:  ','Others: '][i++]+['None',"$e$o","$w$o","$w$a$e","$r$o","$r$a$e","$r$a$w","$r $w$a$e"][it as int])
  }
}

Java 7, 300 284 bytes
String c(String s){char[]a=s.toCharArray();return"User:   "+f(a[0])+"Group:  "+f(a[1])+"Others: "+f(a[2]);}String f(int i){return new String[]{"None","Execute only","Write only","Write and Execute","Read only","Read and Execute","Read and Write","Read Write and Execute"}[i%48]+"\n";}

Direct approach for now. Will try to come up with a more generic approach to reuse the words.
Ungolfed & test cases:
Try it here.
class M{
  static String c(String s){
    char[] a = s.toCharArray();
    return "User:   " + f(a[0]) + "Group:  " + f(a[1]) + "Others: " + f(a[2]);
  }

  static String f(int i){
    return new String[]{ "None", "Execute only", "Write only", "Write and Execute", "Read only", "Read and Execute", "Read and Write", "Read Write and Execute" }
      [i % 48] + "\n";
  }

  public static void main(String[] a){
    System.out.println(c("666"));
    System.out.println(c("042"));
    System.out.println(c("644"));
  }
}

Output:
User:   Read and Write
Group:  Read and Write
Others: Read and Write

User:   None
Group:  Read only
Others: Write only

User:   Read and Write
Group:  Read only
Others: Read only

C#, 322 337 348 bytes
That's for sure not the shortest version, but I tried solving this problem using bitwise operators since the chmod values are actually bit flags. Also C# is probably not the best golfing language :D
string P(string s){Func<int,string>X=p=>{var a=new List<string>();if((p&4)>0)a.Add("Read");if((p&2)>0)a.Add("Write");if((p&1)>0)a.Add("Execute");return a.Count>1?string.Join(" ",a.Take(a.Count-1))+" and "+a.Last():a.Count>0?a.First()+" only":"none";};return string.Join("\n",(new[]{"User:   ","Group:  ","Others: "}).Select((c,i)=>c+X(s[i]-'0')));}

ungolfed: (with comments)
string P(string s)
{
    // Function that determines the permissions represented by a single digit (e.g. 4 => "Read only")
    Func<int, string> X = p =>
    {
        var a = new List<string>();         // temporary storage for set permissions
        if ((p & 4) > 0) a.Add("Read");     // Read bit set
        if ((p & 2) > 0) a.Add("Write");    // Write bit set
        if ((p & 1) > 0) a.Add("Execute");  // Execute bit set

        // actually just Output formatting ... Takes a lot of bytes *grr*
        return a.Count > 1
            ? string.Join(" ", a.Take(a.Count - 1)) + " and " + a.Last()
            : a.Count > 0
                ? a.First() + " only"
                : "none";
    };

    // Actual result:
    return string.Join("\n", (new[] { "User:   ", "Group:  ", "Others: " })
        .Select((c, i) => c + X(s[i] - '0'))); // Map "User, .." to its permissions by using above function
}

This is my first time code golfing, so please tell me, if I did anyting wrong :)
EDIT 1:
Saved some bytes by replacing s[i]-'0' by s[i]&7 (at the very end) and saving list count into variable:
string P(string s){Func<int,string>X=p=>{var a=new List<string>();if((p&4)>0)a.Add("Read");if((p&2)>0)a.Add("Write");if((p&1)>0)a.Add("Execute");var c=a.Count;return c>1?string.Join(" ",a.Take(c-1))+" and "+a.Last():c>0?a[0]+" only":"none";};return string.Join("\n",(new[]{"User:   ","Group:  ","Others: "}).Select((c,i)=>c+X(s[i]&7)));}

EDIT 2:
Changed to lambda expression:
s=>{Func<int,string>X=p=>{var a=new List<string>();if((p&4)>0)a.Add("Read");if((p&2)>0)a.Add("Write");if((p&1)>0)a.Add("Execute");var c=a.Count;return c>1?string.Join(" ",a.Take(c-1))+" and "+a.Last():c>0?a[0]+" only":"none";};return string.Join("\n",(new[]{"User:   ","Group:  ","Others: "}).Select((c,i)=>c+X(s[i]&7)));}

Mathematica, 211 bytes
{r,w,e,o,a}={"Read ","Write ","Execute ","only ","and "};""<>Transpose@{{"User:   ","Group:  ","Others: "},"None"[{e,o},{w,o},{w,a,e},{r,o},{r,a,e},{r,a,w},{r,w,a,e}][[#]]&/@IntegerDigits[#,10,3],"\n"&~Array~3}&

A straightforward implementation (probably easily beatable): doesn't compute anything, just hard-codes each possible output. Input is an integer; outputs each line with a trailing space, and a trailing newline overall.
IntegerDigits[#,10,3] gives the three digits of the input (even if there are leading zeros). Each digit indicates an argument of the "function"
"None"[{e,o},{w,o},{w,a,e},{r,o},{r,a,e},{r,a,w},{r,w,a,e}]

with 0 indicating the function name itself. ""<> concatenates all the strings in a list (of lists). "\n"&~Array~3 produces the three newlines.

I just noticed that my Python 2 answer is almost identical to yours, even using the same variable names. I honestly hadn't seen yours before I posted!

no worries! I think the variable names' matching is pretty much to be expected in this situation :)

Guess you're right. The variable names were a bit predictable ☺

btw, +1 cos we think the same way :-)

btw, I don't know Mathematica but I think you may be able to lose a byte by removing the space from "only ". It will always be at the end of a line so doesn't need a trailing space.

C# 307 241 210 bytes
string X(string s){var z="User:  ,Group: ,Others:,5,34,14,123,04,023,021,0123,Read,Write,and,Execute,only,None".Split(',');return string.Join("\n",s.Zip(z,(a,b)=>b+z[a-45].Aggregate("",(x,y)=>x+" "+z[y-37])));}
Formatted
string X(string s)
{
    var z = "User:  ,Group: ,Others:,5,34,14,123,04,023,021,0123,Read,Write,and,Execute,only,None".Split(',');
    return string.Join("\n", s.Zip(z, (a, b) => b + z[a - 45].Aggregate("", (x, y) => x + " " + z[y - 37])));
}

Java 7, 278
Golfed:
String f(String i){String o="";for(int n=0;n<i.length();)o+=(n<1?"User:   ":n<2?"Group:  ":"Others: ")+new String[]{"None","Execute only","Write only","Write and Execute","Read only","Read and Execute","Read and Write","Read Write and Execute"}[i.charAt(n++)-48]+"\n";return o;}

Ungolfed:
  String f(String i) {
    String o = "";
    for (int n = 0; n < i.length();)
      o += (n < 1 ? "User:   " : n < 2 ? "Group:  " : "Others: ")
        + new String[] { "None", "Execute only", "Write only", "Write and Execute", "Read only", "Read and Execute",
            "Read and Write", "Read Write and Execute" }[i.charAt(n++) - 48]
        + "\n";
    return o;
  }

Output:
User:   Read and Write
Group:  Read and Write
Others: Read and Write

User:   None
Group:  Read only
Others: Write only

User:   Read and Write
Group:  Read only
Others: Read only

Python 3.5, 3.6 - 235 232 228 216 bytes
(should work on all Python 3.x)
So the input is on STDIN here (saves an import ☺).
a=input()
r=range
for i in r(3):
 p=int(a[i]);x=[["Read","Write","Execute"][j]for j in r(3)if 4>>j&p]
 if x[1:]:x[-1:-1]="and",
 if len(x)==1:x+="only",
 print(["User:  ","Group: ","Others:"][i]," ".join(x)or"None")

Making use of tuples, omitting spaces where possible and operator precedence where you would normally put parentheses to make your intentions clear.
Sample usage:
$ echo -n '666' | python3 golf2.py
User:   Read and Write
Group:  Read and Write
Others: Read and Write
$ echo -n '644' | python3 golf2.py
User:   Read and Write
Group:  Read only
Others: Read only
$ echo '042' | python3 golf2.py
User:   None
Group:  Read only
Others: Write only
$ echo '123' | python3 golf2.py
User:   Execute only
Group:  Write only
Others: Write and Execute
$ echo -n '777' | python3 golf2.py
User:   Read Write and Execute
Group:  Read Write and Execute
Others: Read Write and Execute

Un-golfed:
input_perms = list(map(int, input()))

entities = ["User", "Group", "Others"]
perm_names = ["Read", "Write", "Execute"]

for i in range(3):
    bits = input_perms[i]
    perms = [
        perm_names[j]
        for j in range(3)
        if (1 << (2-j)) & bits
    ]

    if len(perms) > 1:
        perms.insert(-1, "and")
    if len(perms) == 1:
        perms.append("only")

    print("{:7} {}".format(
        entities[i]+":",
        " ".join(perms) or "None"
    ))

Batch, 280 bytes
@echo off
set/pc=
call:l "User:   " %c:~0,1%
call:l "Group:  " %c:~1,1%
call:l "Others: " %c:~2,1%
exit/b
:l
for %%s in (None.0 Execute.1 Write.2 "Write and Execute.3" Read.4 "Read and Execute.5" "Read and Write.6" "Read Write and Execute.7") do if %%~xs==.%2 echo %~1%%~ns

Hardcoding the strings was 47 bytes shorter than trying to piece them together. Would have been 267 bytes if tabs were legal.

Visual Basic, 606 Bytes
imports System.Collections
module h
sub main()
Dim i As String=console.readline()
Dim s=new Stack(new String(){"Others: ","Group:  ","User:   "})
for each j as Char in i
dim t=new Stack()
if((asc(j) MOD 2)=1)then t.push("Execute")
if(asc(j)=50 or asc(j)=51 or asc(j)=54 or asc(j)=55)then t.push("Write")
if(asc(J)>51)then t.push("Read")
if t.count=3 then
w(s.pop+t.pop+" "+t.pop+" and "+t.pop)
else
if t.count=2 then
w(s.pop+t.pop+" and "+t.pop)
else
if t.count=0 then
w(s.pop+"None")
else
w(s.pop+t.pop+" only")
end if
end if
end if
next
end sub
sub w(s As String)
console.writeline(s)
end sub
end module

Welcome to PPCG! Nice first answer BTW :)

Crystal, 200 194 Bytes
def m(y)y=y.chars.map &.to_i
a=" and "
o=" only"
r="Read"
w="Write"
x="Execute"
c=["None",x+o,w+o,w+a+x,r+o,r+a+x,r+a+w,r+" "+w+a+x]
"User:   "+c[y[0]]+"
Group:  "+c[y[1]]+"
Others: "+c[y[2]]end

returns the resulting string for a given octal-sequence as a string.
e.g.: m("670") results to: User:   Read and Write\nGroup:  Read Write and Execute\nOthers: None.
Try it online.

C#, 371 bytes
public String[] a = {"none","Execute only","Write only","Write and Execute","Read only","Read and Execute","Read and Write","Read Write and Execute"};
public String pA(int i){return a[i];}
public int d(int n,int i){
  n=n/Math.pow(10,i);
  return n%=10;
}
public void main(int i){
  Console.Write("User:\t{0}\nGroup:\t{1},Others:\t{2}",pA(d(i,0)),pA(d(i,1)),pA(d(i,2));
}

This is code-golf, so you must golf your code. Also, add a header with the name of the language and the bytecount.

I've added your byte count, which is your score. You need to get your score as low as possible to win

For example, you get rid of all of the unnecessary whitespace in each function

@BetaDecay Thanks,I'm new to this community and I think I'd better to use php instead which could be  lead to more compacts codes.

@Alireza That's a good idea. Although on this site, we do like to see short answers in Java and C# :)

@AlirezaTabatabaeian I don't think you should just abandon a language. For a head start, remove any unnecessary spaces and newlines, and try to use \t to denote a literal tab character, i.e. \t is one byte, not two.

I was going to write a C# answer, but yours is actually pretty good with a few modifications. There's quite a bit you can do with this one. You can remove the whitespace, use lambdas and use string interpolation. I was able to get it down to 291 without touching the string array. Although, and this is the problem with C# for golf, if it's a full program that's required it'll jump right back to ~400 because of the namespace and class definitions required to make it execute :/

PHP ,199 Bytes
foreach([User,Group,Others]as$i=>$u){$a=[];foreach([Read,Write,Execute]as$k=>$s)if($argv[1][$i]&4>>$k)$a[]=$s;$a[]=($x=array_pop($a))?$a?"and $x":"$x only":None;echo str_pad("\n$u:",9).join(" ",$a);}

PHP ,189 Bytes with \t
foreach([User,Group,Others]as$i=>$u){$a=[];foreach([Read,Write,Execute]as$k=>$s)if($argv[1][$i]&4>>$k)$a[]=$s;$a[]=($x=array_pop($a))?$a?"and $x":"$x only":None;echo"\n$u:\t".join(" ",$a);}

Hey, you should use spaces instead of tabs

In this case \t looks like str_repeat(" ",3-$i) or str_pad("",3-$i," ") but is does not matter with my idea I have no chance to win.If I Should take another space https://www.cs.tut.fi/~jkorpela/chars/spaces.html

13+34 bytes to save.
In the long version:
Use echo str_pad("$u:",8) instead of echo"$u:".str_repeat(" ",3-$i) (-9);
this renders $i=> obsolete (-4).
In both versions:
Use $a[$z-1]="and $a[$z-1]"; instead of {$a[]=$a[$z-1];$a[$z-1]="and";} (-7)
and else$a[]=$a?Only:None; instead of elseif($z<1)$a[]=None;else$a[]=Only; (-14).
Turn if(1<$z=count($a))$a[$z-1]="and $a[$z-1]";else$a[]=$a?Only:None;
into if($x=array_pop($a))$a[]=$a?"and $x":"$x Only";else$a[]=None; (-3)
and then into $a[]=($x=array_pop($a))?$a?"and $x":"$x Only":None; (-10)

@Titus echo str_pad("$u:",8),$a[$z-1]="and $a[$z-1]";,else$a[]=$a?Only:None; Done $i=> obsolete I can not do then $m=$argv[1][$i] is necessary. For the rest I would try first another way. Thank You for the input

meta hint: check the help on comments. You can use mini-Markdown: links, italic, bold and code.

More ideas: if(4&$m=$argv[1][$i]) instead of $m=$argv[1][$i];if(4&$m) (-3) OR replace $m=;if();if();if(); with a loop: foreach([Read,Write,Execute]as$k=>$s)if($argv[1][$i]&4>>$k)$a[]=$s; (-7)

the foreach loop is a very good idea. my version can't crack your version and maybe we can force your version

The double ternary assignment can be put inside the join: join(" ",$a[]=...) (-3). Leading instead of trailing newline str_pad("\n$u:",9) could give another (-3). I think that´s all that can be done here.

Python 3.5 - 370 294 243 bytes
Golfed:
import sys
a=lambda o: [print(('User:  ','Group: ','Others:')[n],('None','Execute only','Write only','Write and Execute','Read only','Read and Execute','Read and Write','Read Write and Execute')[int(o[n])]) for n in range(0,3)]
a(sys.argv[1])

Size check:
$ du -b OctalToHuman.py
243     OctalToHuman.py

Un-golfed:
#!/usr/bin/env python3
from sys import argv as ARGS

types = ('User:  ', 'Group: ', 'Others:')
perms = ('None','Execute only','Write only','Write and Execute','Read only','Read and Execute','Read and Write','Read Write and Execute')

def convert(octal_string):
    for n in range(0,3):
        print(types[n], perms[int(octal_string[n])])

if __name__ == '__main__':
    convert(ARGS[1])

Sample output:
$ python ./OctalToHuman.py 666
User:   Read and Write
Group:  Read and Write
Others: Read and Write

$ python ./OctalToHuman.py 042
User:   None
Group:  Read only
Others: Write only

$ python ./OctalToHuman.py 644
User:   Read and Write
Group:  Read only
Others: Read only

This is not a serious contender for the winning criteria. We require all answers to make a serious attempt at optimizing their score for the winning criteria (for example, in code golf challenges such as this one, submissions must make a serious attempt at minimizing the byte count of the program).

You can save quite a few bytes by removing import sys, and just making the program an anonymous function (lambda o:...).

Sinclair BASIC - 263 257 bytes
I did one version using the same approach as everyone else (load of string variables put into array) in 227 bytes, so going to post this one as a different way of doing it.
EDIT - As pointed out, there were some extraneous "and" appearing, this is now resolved
1 p=0,z$="and ": INPUT c$
2 FOR EACH a$ IN ["User:   ","Group:  ","Others: "]
3 p+=1,n=VAL c$(p),r=(n & 4)>0,w=(n & 2)>0,x=(n & 1)>0,t=r+w+x
4  ?a$;("Read "*r)+(z$*(r AND (t=2)))+("Write "*w)+(z$*(w AND x))+("Execute "*x)+("only"*(t=1))+("None"*(t=0))
5 NEXT a$

Uses bitwise-AND & operation to see if the number has 4,2 or 1 bits set and then prints the different permissions. Adding "and" in between multiple values took up most of the space.
Screenshot shows example for 670 as input

Does not follow the spec. Your second line should say Read Write and Execute. This answer should be non- competing.

I love Sinclair BASIC. Which interpreter do you use?

Not sure if someone changed the language name, it's actually SpecBAS which is a more modern version of the original Sinclair BASIC

Javascript (ES6), 159 bytes
a=>`User:  ${(b=[' None',(c=' Execute')+(d=' only'),(e=' Write')+d,f=e+(g=' and')+c,(h=' Read')+d,h+g+c,h+g+e,h+f])[a[0]]}\nGroup: ${b[a[1]]}\nOthers:`+b[a[2]]

Example:
(a=>`User:  ${(b=[' None',(c=' Execute')+(d=' only'),(e=' Write')+d,f=e+(g=' and')+c,(h=' Read')+d,h+g+c,h+g+e,h+f])[a[0]]}\nGroup: ${b[a[1]]}\nOthers:`+b[a[2]])("042")

F#, 204 203 Bytes
my first golf, so do please forgive any mistakes ;)

The golfed version (based 1:1 on pinkfloydx33's answer):

fun(y:string)->let e,r,w,o,a="Execute ","Read ","Write ","only","and ";let z=["None";e+o;w+o;w+a+e;r+o;r+a+e;r+a+w;r+w+a+e;];let(!-)a=z.[int y.[a]-48];sprintf"User:   %s\nGroup:  %s\nOthers: %s"!-0!-1!-2

The ungolfed version:
fun (y : string) ->
    let e, r, w, o, a = "Execute ", "Read ", "Write ", "only", "and "
    let z = [
                "None";
                e + o;
                w + o;
                w + a + e;
                r + o;
                r + a + e;
                r + a + w;
                r + w + a + e;
            ]
    let (!-) a = z.[int(y.[a]) - 48]
    sprintf "User:   %s\nGroup:  %s\nOthers: %s" !-0 !-1 !-2

Example usage:
let k =  ...... // function definition goes here

printf"%s"<|k"755"
printf"%s"<|k"042"
// etc ...

This is solely to check, whether I could 'improve' pinkfloydx33's answer - I do not take any credit for the algorithm

Python 3, 191 bytes
def d(n):a,b,c,d,e=' and ',' only',"Execute","Write","Read";l=["None",c+b,d+b,d+a+c,e+b,e+a+c,e+a+d,e+" "+d+a+c];y,u,i=map(int,n);return"User:   %s\nGroup:  %s\nOthers: %s\n"%(l[y],l[u],l[i])

ungolfed
def d(n):
    a,b,c,d,e=' and ',' only',"Execute","Write","Read"
    l=["None",c+b,d+b,d+a+c,e+b,e+a+c,e+a+d,e+" "+d+a+c]
    y,u,i=map(int,n)
    return"User:   %s\nGroup:  %s\nOthers: %s\n"%(l[y],l[u],l[i])

Welcome to PPCG! nice first post!

Hmm, I'm very curious how moderator got 151bytes when I only get 191 :D Is it mistake? Check edits

That was me, sorry. I typo'ed in the edit. Fixed now.

Perl -p, 149 (148+1) bytes
This is a port to Perl of Firefly's sed answer.
s/(.)(.)/User:   \1
Group:  \2
Others: /;s/[4-7]/Read $&/g;s/[2367]/Write $&/g;s/[1357]/Execute $&/g;s/0/None/g;s/\w \K(\w+) \d/and $1/g;s/\d/only/g

Compared to sed:

Perl uses $& instead of & (+ 3 bytes).
Perl has \d, which we use instead of [1-7] (-6 bytes).
Perl has \K (-3 bytes).
Perl allows literal newlines in the replacement part of s/// (-2 bytes).


text:
Generate Menu Access Keys
This is thematically similar to Generate keyboard shortcuts for a menu, but its actually a pretty different challenge.
Let's take PHPStorm's menu as an example:
New Project
New
Open Directory
Open
Open URL
New Project from Existing Files
Save As
Open Recent
Close Project
Rename Project

We need to assign a single-letter access keys for each of these menu items.  Typically we pick the first letter, but if you notice, many of the above menu items start with the same letter!
Therefore, we'd want to pick:
P -> New Project
N -> New
D -> Open Directory
O -> Open
U -> Open URL
F -> New Project from Existing Files
S -> Save As
E -> Open Recent  (We don't pick "R" here because "Rename Project" needs it)
C -> Close Project
R -> Rename Project

Therefore, for our list we need to maximize (in order of importance):

The number of access keys actually contained in the string.

["X" -> "New"] should be avoided unless its your only option.

The number of access keys that start a word.

["N"->"New", "P"->"New Project"] is better than ["E"->"New", "N"->"New Project"]

The number of access keys that start the sentence.

["N"->"New Project"] is better than ["P"->"New Project"]

Access keys are case-insensitive, so if your menu is ["Add", "add"], one of them will need to use D as its access key.
Input/output
You need to input a list of strings.  The strings will only contain alphabetic characters and spaces.  You can optionally input a single string with a delimiter for each of the lines.  You can assume there will be between 1 and 26 menu items (inclusive).
You need to output either:

A Key-value map, where the key is the access key letter, and the value is the string it maps to
A list of access key letters, where the Nth entry pairs with the Nth item in the list.

You can either return the objects themselves, or a reasonable string representation of them. Access key letters can be in any case.
Test Cases:
A                            -> A
Add,add                      -> A,D
Add To,Add                   -> T,A
Add To,Add Around,Add For    -> T,A,F
Add To,Flip To,Add For       -> T,F,A
Add,add,Dip,Around           -> A,D,I,R
Add,add,Dad                  -> A,B,D
Add,add,Dad,dad,ad dadad,B   -> A,C,D,E,Z,B
A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,A,B,C -> A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z
A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,Add,Bz,Cx -> A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,Y,Z,X

What about non-unique outputs? I assume for your test case D,A would also be a valid output, right? What if priority number 1 can't be avoided? Test case Add,add,ADD.

D,A is valid output.  I've got a test case for that already: Add,add,Dad -> A,B,D

Ah okay, might be worth mentioning those things in the spec. "...should be avoided at all costs" sounds like it's an invalid solution.

Can we assume that only first letters in a word are upper case, i.e. that CamelCase will not appear? Or doesn´t it matter?

No.  Words are defined by whitespace, not by case.

Add,add,Dad,dad,ad dadad,D,B has 7 menu items, but only 6 keys. I guess it should be A,?,D,?,?,?,B.

Are we free to chose any characters that are not in the sentences?

@Titus fixed, thanks.  You are free to chose any alphabetic (A-Z) character.

@Titus I rejected your edit because there are several possibilities on nearly every test case given, and ? doesn't always work, as it sometimes can only be one of several letters.

What is the scoring method? It’s tagged code-golf, so I’m assuming shortest answer in bytes?

That is correct

Jelly, 41 bytes
e/€S;eḲ1ịⱮƊ}¥/€;=Ḣ¥/€µS
LØAœ!ż€³Œu¤ÇÐṀẎḢ€

Try it online!
This is really messy and also O(26^n) lol.
Explanation: literally just brute forces it ._.
-6 bytes thanks to caird coinheringaahing

45 bytes

@cairdcoinheringaahing ah, nice you figured it out :D thank you

41 bytes

@cairdcoinheringaahing Oh, yeah, I didn't realize that since the conditions are subsets of each other I don't need to separate them and keep them in order lol. Thanks!

source: Stack Exchange

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

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

sort: votes


text:
Shuffle a mapping
We define a map as a set of key-value pairs.  For this challenge, you need to take each of the values and assign them to a randomly chosen key.

You must randomly shuffle the values, and output the resulting map.  This means that each time we run your program, we have a chance of getting a different output
Each possible permutation of the values must have a non-zero chance of appearing.
All of the original keys and original values must appear in the resulting array.  Repeated values must appear the same number of times in the resulting array.

For example, if your map was:
[0:10, 1:10, 5:5]

all of the following must have a chance of appearing:
[0:10, 1:10, 5:5]  (original map)
[0:10, 1:5,  5:10]
[0:10, 1:10, 5:5]  (technically the same map, but I swapped the two tens)
[0:10, 1:5,  5:10]
[0:5,  1:10, 5:10]
[0:5,  1:10, 5:10]

Acceptable input/outputs:

Your languages' native map
You can input an array of key-value pairs.  You may not input 2 arrays, one with keys, the other with values.
You can use a string representation of any the above
If you input an array or a map, you can modify the original object instead of returning
The input type must match the output type
If you input an array, the order of the keys must be maintained.
You can assume that the keys are unique, but you cannot assume that values are unique.

This is a code-golf, so answer as short as possible

Very closely related. (The differences are that in mine the keys are simply the indices of the array, that I require a uniform probability over all permutations and that I disallow built-ins.)

Do the KV pairs have to be in the order [k, v] or would [v, k] be acceptable?

They need to be in [k, v]

Can we input a native map and output an array of key-value pairs?

No, the types need to match.

The closest equivalent to a map (or array that supports key/value pairs) in R is a list which only supports string keys, e.g. list(fish = 1, dog = 2, cat = 3, monkey = 4, harambe = 69). Is it requirement to be able to handle integer keys?

@Billywob that's fine.

05AB1E, 5 bytes
Input is a list of key-value pairs.
ø       # zip into a list of keys and one of values
 `      # flatten
  .r    # randomize the values
    ø   # zip back again into a list of key-value pairs.

Try it online!

Brachylog, 13 12 bytes
zt@~T,?zh:Tz

Try it online!
Expects a list of 2-element lists as input.
Explanation
z              Zip the input to get a list of keys and a list of values
 t@~T,         Take the list of values, and shuffle it ; call that T
      ?zh      Zip the input to get the list of keys
         :Tz   Zip the list of keys with the list of shuffled values

Jelly, 5 bytes
Ṫ€Ẋṭ"

Try it online!
Explanation
Ṫ€Ẋṭ"  Input: list of [k, v] pairs
Ṫ€     Pop and return the last element of each k-v pair (modifies each list)
  Ẋ    Shuffle the list of v's
   ṭ"  Append each v back to a k and return

Looks like TEXt"

CJam, 9 bytes
{z)mra+z}

Input is a list of key-value pairs.
Test it here.
Explanation
z  e# Zip, to separate keys from values.
)  e# Pull off values.
mr e# Shuffle them.
a+ e# Append them to the array again.
z  e# Zip, to restore key-value pairs.

Alternative solution, same byte count:
{[z~mr]z}

Pretty sure this is the shortest algorithm in most languages that have Zip :p

Python 2, 77 bytes
Uses this option: If you input an array or a map, you can modify the original object instead of returning. Input is a dictionary literal like {0: 10, 1: 10, 5: 5}.
from random import*
D=input()
k=D.keys()
shuffle(k)
D=dict(zip(k,D.values()))

Try it online
Inspiration taken from this SO answer.

Python 3, 107 bytes
Uses Python's native dictionary structure.
Thanks to @mbomb007 for saving a byte.
from random import*
def f(d,o={}):
 i=list(d.values());shuffle(i)
 for k in d.keys():o[k]=i.pop()
 return o

Ideone it!

Put the import before the function, and use from random import*.

Remove the .keys(). Iterating a dictionary iterates over the keys. Use return dict(zip(d, i)) instead of the for loop.

Perl, 35 bytes
Includes +2 for -0p
Give each keys/value separated by space on a STDIN line
shuffle.pl
1 5
3 8
9 2
^D

shuffle.pl:
#!/usr/bin/perl -p0
@F=/ .*/g;s//splice@F,rand@F,1/eg

Mathematica, 32 bytes
{#,RandomSample@#2}&@@(#)&

Input is a list of key-value pairs.  is Mathematica's transposition operator, and RandomSample can be used to shuffle a list.

Clojure, 40 34 bytes
#(zipmap(keys %)(shuffle(vals %)))

Takes the keys and values from m (a map), shuffles the values and zips them up into a map.

Use the function macro: #(zipmap(keys %)(shuffle(vals %)))

php, 84 bytes
<?= serialise(array_combine(array_keys($a=unserialize($argv[1])),shuffle($a)?$a:0));

Takes input as a serialised array, outputs the same.

Wolfram Language (Mathematica), 26 bytes
RandomSample~SubsetMap~All

Try it online!
Input an Association, Mathematica's built-in mapping type.
Since SubsetMap acts on a List of values of the subset, keys stay in place while values are shuffled. For some reason, it seems like SubsetMap does not consider ;; a valid Span of all elements, so we use All instead.
SubsetMap was introduced in 2019 (v12.0), postdating this challenge.

Python, 73 70 bytes
-3 thanks to @tsh
lambda d:dict(zip(d,sample([*d.values()],len(d))))
from random import*

Attempt This Online!
Pretty straightforward. I think this is valid Python 3.5 (available at the time of the OP).

list(xyz) could be [*xyz]

Right!! Thanks.

PowerShell v2+, 52 bytes
param($a)$a|%{$_[1]}|sort {random}|%{$a[$i++][0],$_}

Takes input as an array of tuples, which is significantly shorter than using a hash (which would require .GetEnumerator() and whatnot to work).
We loop the input array |%{...}, each iteration pulling out the second element $_[1]. Those are piped into Sort-Object with the {Get-Random} as the sorting key. This will assign a random weight from 0 to [Int32]::MaxValue to each element for sorting. Those are piped into another loop |%{...}, with each iteration outputting a tuple of the corresponding first element of the tuple and the sorted number.
Examples
The examples here have an additional -join',' on the tuple output so it's shown better on the console, as the default output for multi-dimensional arrays is hard to read.
PS C:\Tools\Scripts\golfing> .\shuffle-a-mapping.ps1 ((0,10),(1,10),(5,5))
0,10
1,5
5,10

PS C:\Tools\Scripts\golfing> .\shuffle-a-mapping.ps1 ((0,10),(1,10),(5,5))
0,10
1,10
5,5

PS C:\Tools\Scripts\golfing> .\shuffle-a-mapping.ps1 ((1,1),(2,2),(3,3),(4,4),(5,5))
1,2
2,4
3,3
4,5
5,1

This works for non-integer values as well with no modifications.
PS C:\Tools\Scripts\golfing> .\shuffle-a-mapping.ps1 (('one','one'),('two','two'),('three','three'),('four','four'))
one,four
two,three
three,two
four,one

JavaScript (ES6), 89 bytes
a=>a.map((_,i)=>[i,Math.random()]).sort((a,b)=>a[1]-b[1]).map(([i],j)=>[a[j][0],a[i][1]])

Perl 6, 28 bytes
{%(.keys.pick(*)Z=>.values)}

Input is a Hash
( Technically any value with a .keys method and a .values method would work, but the output is a Hash )
Explanation:
# bare block lambda with implicit parameter ｢$_｣
{

  # turn the list of key => value Pairs into a Hash
  %(
      # get the keys from ｢$_｣ ( implicit method call on ｢$_｣ )
      .keys

      # get all of the keys in random order
      .pick(*)

    # zip using ｢&infix:« => »｣ the Pair constructor
    Z[=>]

      # the values from ｢$_｣ ( implicit method call on ｢$_｣ )
      .values
  )
}

A variant that would work for the other built in Hash like object types is:
{.WHAT.(.keys.pick(*)Z=>.values)}

.WHAT on an object returns the type.

R,  47 (28) bytes
A bit late to the party but though I'd post a solution in R using builtins.
The closest thing R has to an array with key/value mapping is a list. The following function takes a list object as input and outputs a list with its values shuffled.
function(x)return(setNames(sample(x),names(x)))

Explained
The builtin setNames() can assign names to objects by inputting a R-vector of names. Hence, first shuffle the list by sample() which shuffles the pairs, and then assign the names in the original order using names().
Example:
z  <- list(fish = 1, dog = 2, cat = 3, monkey = 4, harambe = 69)

f=function(x)return(setNames(sample(x),names(x)))
f(z)

$fish
[1] 3

$dog
[1] 1

$cat
[1] 2

$monkey
[1] 69

$harambe
[1] 4

If x is assumed to be defined there's no need for function wrapping and the program reduces to 28 bytes.
setNames(sample(x),names(x))

Java 7, 156 bytes
import java.util.*;void c(Map m){List t=new ArrayList(m.values());Collections.shuffle(t);Iterator i=t.iterator();for(Object k:m.keySet())m.put(k,i.next());}

Ungolfed:
void c(Map m){
  List t = new ArrayList(m.values());
  Collections.shuffle(t);
  Iterator i = t.iterator();
  for(Object k : m.keySet()){
    m.put(k, i.next());
  }
}

Test code:
Try it here.
import java.util.*;
class M{
  static void c(Map m){List t=new ArrayList(m.values());Collections.shuffle(t);Iterator i=t.iterator();for(Object k:m.keySet())m.put(k,i.next());}

  public static void main(String[]a){
    for(int i=0;i<10;i++){
      Map m=new HashMap();
      m.put(0, 10);
      m.put(1, 10);
      m.put(5, 5);
      c(m);
      System.out.println(m);
    }
  }
}

Possible output:
{0=5, 1=10, 5=10}
{0=10, 1=10, 5=5}
{0=10, 1=5, 5=10}
{0=10, 1=10, 5=5}
{0=10, 1=10, 5=5}
{0=10, 1=10, 5=5}
{0=10, 1=10, 5=5}
{0=10, 1=10, 5=5}
{0=10, 1=5, 5=10}
{0=5, 1=10, 5=10}

J-uby, 29 bytes
Takes a Hash, returns an array of key-value pairs.
:zip%[:keys,:values|:shuffle]

Attempt This Online!
J-uby, 37 bytes
Takes a Hash, returns a Hash.
(:zip|:to_h)%[:keys,:values|:shuffle]

Attempt This Online!

Swift 5.9, 65 bytes
let f={(k:[(Int,Int)])in[]+zip(k.map(\.0),k.map(\.1).shuffled())}

Takes input as an Array of tuples, because I'd have to convert a native Dictionary into an array of tuples anyway.

JavaScript (Node.js), 70 bytes
f=a=>a[b=1/Math.random()|0]?f(a,t=a[b][1],a[b][1]=a[0][1],a[0][1]=t):a

Try it online!

Python 3, 39 bytes
lambda d:{i:d[s]for i,s in zip(d,{*d})}

Try it online!
This works because string hashes are randomized in Python.

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


text:
The ten hundred most common words
This question is written because "Thing Explainer" is fun to read, and gave me an idea.
Write "stuff that makes computer do things" that reads/takes a set of letters, numbers and things like this "#%|? and returns True / 1 if all words are part of this set.
If all words are not part of that set, return the words that were not a part of it.

This website can be considered correct in all cases. The rules are written to follow the specs on that site.

Examples:
Truthy:
The code should return a truthy value if the entire text above the first horizontal line is pasted as input.
The following lines should return a truthy value (input is separated by ###)
This returns "Hello, World!"
###
tHiS rEtUrNs TrUe...
###
Thing Explainer is a book written by a man.
The man writes books with simple words.
###
This set of stuff "#!^{>7( must return true

Falsey:
In the following examples, input and output are separated by ***. Different test cases are separated by ###.
This code doesn't return "Hello, World!"
***
code
###
tHiS rEtUrN"s false...
***
s
false

More detailed rules:

You can use this to test your code.
Non-letters are interpreted as spaces by the code, except for words like 'wasn't'. The words with apostrophes that returns true are included in the list

For instance: foo123bar should return foo and bar, since they are not part of the list, and 123 can be interpreted as spaces

The input will only contain printable ASCII code points [10, 32-126].
Words can contain mixed case letters. See second test case.
The list of words

should be taken as input (STDIN, function argument or equivalent)
can be modified (words can be separated by newline, comma etc., and you might sort the list)
Note that you can not use this list (it's not identical)

The output can be on any format you like
The output can be upper, lower or mixed case (optional)
There shall be no symbols in the output

For the record, Jonathan Allan found a strange corner case:  the implementation on XKCD will actually ignore any letters after an apostrophe up to the next non-[A-Z][a-z]['] - for example find's found, and find'qazxswedc found' both return nothing, whereas find'qazx.swedc found returns swedc.
You can choose if you want to return nothing for find'qazxswedc found', or return qazxswedc. Returning qazx, swedc for find'qazx.swedc is also OK.

Extremely Related

I'm not positive it's a dupe though. Your challenge is slightly different, since you need to return the non-simple words. And, in your favor, you actually have a normal spec written in everyday English. http://codegolf.stackexchange.com/questions/53323/is-it-simple-or-is-it-hard#comment127413_53323

For a statically typed language that cannot express a return type of Boolean or Array<String>, would returning an empty array/list be permissible?

@CAD97 for the case where all words are simple? You can select how you want to display the truthy value, it can be an integer/string 1. An empty output is not permissible.

I'm confused by the new explanation of rules for the find'qazxswedc input. Are we or are we not supposed to split on apostrophes? For example, isn't returns true (it's in the list), but isn returns isn, since that's not on the list. From that logic, I went with "don't split on apostrophes" and so find'qazxswedc found returns find'qazxswedc.

Note that the "official" word set from XKCD contains non ASCII characters - this apostrophe ’ code point 8217

PowerShell v3+, 105 92 bytes
param($a,$b)$x=@();-split($b-replace"[^a-zA-Z']",' ')|%{if($_-notin$a){$x+=$_}};($x,1)[!$x]

Takes simple words like $a, and words like $b. Makes helper $x. Take each word in $b and get rid of any bad not letters, then check each one |{...}. If that word is not in $a, then we add it to $x. At the end, we choose $x or 1 by not $x. That is sent out, either words or 1.
Some words to try
PS C:\Tools\Scripts\golfing> ('This returns "Hello, World!"','tHiS rEtUrNs TrUe...','Thing Explainer is a book written by a man.
The man writes books with simple words.','This set of stuff "¤!^¤>7\ must return true'|%{"$_";(.\ten-hundred-most-common-words.ps1 (gc .\ten-hundred-most-common-words.txt) $_)})-join"`n###`n"
This returns "Hello, World!"
###
1
###
tHiS rEtUrNs TrUe...
###
1
###
Thing Explainer is a book written by a man.
The man writes books with simple words.
###
1
###
This set of stuff "¤!^¤>7\ must return true
###
1

PS C:\Tools\Scripts\golfing> ("This code doesn't returns Hello, World!",'tHiS rEtUrN"s false...'|%{"$_`n***`n"+(.\ten-hundred-most-common-words.ps1 (gc .\ten-hundred-most-common-words.txt) $_)})-join"`n###`n"
This code doesn't returns Hello, World!
***
code
###
tHiS rEtUrN"s false...
***
s false

Python, 93 bytes
import re
lambda w,s:[w for w in re.sub("[^'\w]|\d|_",' ',w).split()if w.lower()not in s]or 1

All test cases are at ideone
Preprocessing of the list is to split on | and put it in a set (which I imagine is fine if pre-sorting is allowed). Input words as w and the set as s.
If that's not allowed this becomes 98 bytes with not in s becoming not in set(s).
We could preprocess it to have all permutations of upper and lower case characters too and save 8 bytes, but I think that might be going too far (that would be a huge set).


text:
Validate a stem-and-leaf plot
A stem and leaf plot displays a bunch of numerical values in groups, which are determined by all but the last digit. For example, suppose we have this set of data:
0, 2, 12, 13, 13, 15, 16, 20, 29, 43, 49, 101

We could produce this stem and leaf plot:
0|02
1|23356
2|09
3|
4|39
5|
6|
7|
8|
9|
10|1

The first row's stem is 0, so its "leaves" - the digits after the | - represent the values between 0 inclusive and 10 exclusive. The leaves on each stem are sorted. Stems with no leaves (like 3) still appear in the plot. The value of 101 is between 100 inclusive and 110 exclusive, so its stem is 10 (100 divided by 10).
Your challenge is to check whether a piece of text is a valid stem and leaf plot. A valid plot satisfies these rules:

Has exactly one row for every stem (i.e. 10-wide group) in the range of the data (including stems in the middle of the range with no leaves)
Has no stems outside the range
All leaves are sorted ascending to the right
All stems are sorted ascending down
Has only numeric characters (besides the separator |)

You do not have to deal with numbers that have fractional parts. You may approve or reject extra leading zeros in the stems, but a blank stem is not allowed. There will be at least one value. You may only assume extra spaces after the leaves on each row. You may assume a leading and/or trailing newline. All characters will be printable ASCII.
Your function or program should return or output (to screen or the standard output) a truthy value for a valid plot, or a falsy value for an invalid plot. You may take input from the standard input, from a file, as one big string, as an array of strings - whatever is most convenient.
Here are some test cases that are valid plots (separated by blank lines):
2|00003457
3|35
4|799
5|3

99|3
100|0556
101|
102|
103|8

0|0

Here are some test cases that are invalid plots, with commentary to the right:
|0               Blank stem

5|347            Missing a stem (6) in the range
7|9

4|               Has a stem (4) outside the range
5|26
6|7

11|432           Leaves aren't sorted correctly
12|9989

5|357            Stems aren't sorted correctly
4|002
6|1

4|5              Duplicate stem
4|6
4|6
5|1

51114            No stem and leaf separator
609

1|2|03           Multiple separators
2|779|

4|8abcdefg9      Invalid characters
5|1,2,3

75 | 4 6         Invalid characters (spaces)
76 | 2 8 8 9

This is code golf, so the shortest code wins! Standard loopholes are disallowed.

This is a very nice first challenge, awesome job! :) I’d add an invalid test case that has a line like 1|2|3 in it.

Excellent first challenge!

Nice first challenge. One test case you maybe could add is similar to the 4|;5|26;6|7 which has the first stem outside the range, but instead at the end, i.e. 12|3;13|4559;14|.

Perl, 47 bytes
Includes +2 for -0p
Give input on STDIN
stem.pl:
#!/usr/bin/perl -0p
$"="*";$_=/^((??{$_+$n++})\|@{[0..9,"
"]})+$/

This is awsome... That trick with $" is very nice!

Pip, 60 58 + 1 = 59 bytes
First stab at the problem, probably could use more golfing. Uses the -r flag to read lines of input from stdin. Truthy output is 1, falsy output is 0 or empty string.
g=a+,#g&a@vNE'|NEg@v@v&$&{Y(a^'|1)a@`^\d+\|\d*$`&SNy=^y}Mg

Explanation and test suite pending, but in the meantime: Try it online!

JavaScript, 189 bytes
(x,y=x.split`
`.map(a=>a.split`|`),z=y.map(a=>a[0]))=>!(/[^0-9|\n]|^\|/m.exec(x)||/^\d+\|\n|\|$/.exec(x)||y.some((c,i,a)=>c.length!=2||c[1]!=[...c[1]].sort().join``)||z!=z.sort((a,b)=>a-b))

Same length alternate solution:
(x,y=x.split`
`.map(a=>a.split`|`),z=y.map(a=>a[0]))=>!(/[^0-9|\n]|^\||^.*\|.*\|.*$/m.exec(x)||/^\d+\|\n|\|$/.exec(x)||y.some((c,i,a)=>c[1]!=[...c[1]].sort().join``)||z!=z.sort((a,b)=>a-b))

Defines an anonymous function that takes input as a multiline string.
I'm sure there's more to golf, so let me know if you see any possible improvements.
Explanation:
The function checks for a  number of bad things, and if any of those are true, it returns false (using logical ORs and a NOT)
(x,y=x.split("\n").map(a=>a.split`|`),          //y is input in pairs of stem and leaves
z=y.map(a=>a[0]))                               //z is stems
=>                                              //defines function
!(                                              //logical not
/[^0-9|\n]|^\|/m.exec(x)                        //checks for invalid chars and blank stems
||/^\d+\|\n|\|$/.exec(x)                        //checks for stems out of range
||y.some((c,i,a)=>c.length!=2                   //checks for multiple |s in a line
||c[1]!=[...c[1]].sort().join``))               //checks if leaves are in wrong order
||z!=z.sort((a,b)=>a-b))                        //checks for stems in wrong order

In the alternate solution, checking for multiple |s in a line is done as part of the first regex instead.

If you use test instead of exec (you nearly always want to use test if you only need a boolean result`) then you can probably use bitwise or instead of logical or.

Does this actually check for duplicate or missing stems?

You could save some bytes replacing y.some((c,i,a)=>... by y.some(c=>... since i and a are not used.
And seems like z!=z.sort((a,b)=>a-b) does not work it could be replaced by ''+z!=z.sort()

Batch, 409 bytes
echo off
set/pp=||exit/b1
set t=
set i=%p:|=&set t=%
if "%t%"=="" exit/b1
for /f "delims=0123456789" %%s in ("%i%")do exit/b1
:l
set t=-
set s=%p:|=&set t=%
if "%s%"=="" exit/b1
if not "%s%"=="%i%" exit/b1
set/ai+=1
for /f "delims=0123456789" %%s in ("%t%")do exit/b1
:m
if "%t:~1,1%"=="" goto n
if %t:~0,1% gtr %t:~1,1% exit/b1
set t=%t:~1%
goto m
:n
set/pp=&&goto l
if "%t%"=="" exit/b1

Takes input on STDIN, but exits as soon as it sees an error.


text:
Make me a mooncake!
The mid-autumn festival has begun!
Unfortunately, all my mooncakes were stolen -- they're getting too expensive for small folk such as myself, and I fear I won't be able to eat any this year!
So I turn to you for help. Would you be able to make me some?
For those unaware, let me educate you on what a mooncake looks like.

Mooncakes come in many different sizes!
So I'm gonna give you my input, n, when I want one.
Here are some examples of the output I want:
Mooncake of size n = 3:
    (@@@@@)
    (@MAF@)
    (@@@@@)

Mooncake of size n = 6:
    (@@@@@@@@@@@)
    (@         @)
    (@    M    @)
    (@    F    @)
    (@         @)
    (@@@@@@@@@@@)

That is to say, a mooncake of size n is:

n lines high
2n - 1 @s long
2n + 1 characters long (@s and brackets)

And you better not throw me your too-tiny practice mooncakes!
Assume input will always be n >= 3.
Mooncakes also contain one of the following decorations:

MF
MAF
HMF
JCJ
TTT
ZJ
LF
RF
CF

Which one, it doesn't matter - as long as it is vertically and horizontally centered.
It can be written vertically or horizontally too!
I want variety!
If you're really going to make me two of the same mooncake, the decoration better be different!
That is, multiple executions of your program with the exact same input must not always yield the same decoration.
I can't wait to eat your moon cakes, so the sooner I can receive them (the shorter your code) the better!
Good Luck!

For those wondering about the decorations:
They are the initials of all alternative names for the Mid-Autumn Festival.
A list can be found in the Wikipedia page linked at the top of this post.

Clarifications:
There are no rules regarding leading and trailing whitespace.
Have as much or as little as you like!
The decorations must be in the very center of your mooncake!
On horizontal decorations, this means it must be on the middle line of your cake, and the number of characters to the left and right of the decoration string must be equal.
On vertical decorations, this means it must reside in the middle column of your cake, and the number of characters above and below the decoration must be equal.
Not all decorations must be used!
The only requirement is that there must be more than one possibility for any given input n. The possibilities also do not need to be even.
Functions are acceptable.

Hi, welcome to PPCG! This looks like a great first post. usually we recommend to use the Sandbox for proposed challenges. There you can get feedback from others, and perfect the challenge with things you might have not thought about, before posting it here. That being said, your challenge looks well-thought-out. +1 from me. One question regarding your first example though, why does it read MAF and not MF? I don't see an A in your decoration-options.

Thanks! Sorry, I wasn't aware of the sandbox. Am I able to leave just this one up anyway? About the decoration - that was a mistake. I added MAF to the allowed decorations. Feedback very much appreciated!

Yes, of course it can stay. The Sandbox isn't mandatory. It's just to perfect a challenge and get feedback from multiple other people, before posting it here. I personally always use it, because you might get questions with things you might not have thought about. So you don't have to use the Sandbox, but I can recommend it for future challenges. :)

Are the leading spaces required? Is variation there allowed?

There are no rules regarding leading and trailing spaces. Up to you!

Can we get a bonus for having all decorations in all possible directions?

We shouldn't get a bonus.  Bonuses are bad.

@StevenH. They can be bad and pointless: you need to compute whether the bonus will be appropriate or still bigger than no bonus at all (i.e. writing a 30-byte code for a -10% bonus is bad when you can do it in 20 instead of 27). Also, most answers will try to accomplish the bonus, no matter what. It's like "duping in the same post".

Is a function okay, or must it be runnable (main etc) as-is?

I don't think I will add a bonus for including extra decorations (at this point). Thank you for the suggestion though! Also, I will clarify in the main post shortly - functions are acceptable.

"so the sooner I can receive them (the shorter your code) the better!" You do realize that golfed code will make you receive them later, right?

Hey, I need to manually type all this into my mooncake machine to get the actual mooncakes!

... in which case it's good that none of those contrived languages with non-ASCII character sets have reared their head, because they are a pain to type :)

lol, +1. High-end mooncake brands like Wing Wah (http://www.mooncake.com/) routinely run close to US$50 for a box of four.

Pyth, 71 65 59 58 bytes
Saved 1 byte thanks to @StevenH.
jjRc"(@@)"2++J*KtytQ\@m.[Kd;.[ttQ@,,O"MC"\F]Oc"MAFHMF"3QkJ

Try it online. Test suite.
So much padding.

It's nuts how different this answer is from the one below it in the same language...

You can save one byte by replacing ?%Q2 with @, (reverse the order of the two choices)...Q.  I (ab)used that a lot in golfing my own Pyth answer down.

@StevenH. Thanks, I always forget about modular indexing.

JavaScript ES6, 206 196 192 188 187 180 176 169 165 156 bytes
g=(n,r=new Date%2,a=(s,x,b=' @'[+!s].repeat(n-3+!x))=>`(@${b+(s||'@')+b}@)
`,l=a` `.repeat(n/2-2+n%2))=>a()+l+(n%2?a(r?'MAF':'HMF',1):a('RC'[r])+a`F`)+l+a()

Breakdown
r=new Date%2                           // Sometimes 0, sometimes 1

// Function to create lines of the cake of the form `(@@@@@@@@@)` or `(@  ${s}  @)`
a=(s,x,b=' @'[+!s].repeat(n-3+!x))=>`(@${b+(s||'@')+b}@)
`

// Cake parts
a()                                    // Top of the cake.
l=a` `.repeat(n/2-2+n%2)               // Undecorated inner part.
a(r?'MAF':'HMF',1)                     // Decoration for uneven sized cakes.
a('RC'[r])+a`F`                        // Decoration for even sized cakes.
l                                      // Undecorated inner part.
a()                                    // Bottom part.

My first attempt at code-golf. This can probably be golfed more.
saved 4 bytes thanks to @ETHProductions
Edit
I took the liberty of using Date.now()%2 new Date%2 to satisfy:

multiple executions of your program with the exact same input must not always yield the same decoration

this allows me to save another 7 bytes over +Math.random()>.5
saved another 4 bytes thanks to @Arnauld

Welcome to PPCG, and great first answer! I believe ['MA','HA'][r]+'F' can be golfed to 'MH'[r]+'AF'.

It could, thank you. However, it actually should have been ['MA','HM'][r] + 'F' in the first place, because the solution won't fulfil the spec otherwise. So thank you for making me aware of that typo :)

You can save two bytes by replacing [' R ',' C '][r] with " ${'RC'[r]} ", replacing each " with a backtick.

And ['MA','HM'][r]+'F' is actually two bytes longer than ['MAF','HMF'][r] ;)

Nothing serious, but the +l+a() is missing in your breakdown. ;) I like the idea of painting it all at once.

You can use ' @'[+!s] instead of (s?' ':'@')

Also, you can use new Date%2 instead of Date.now()%2.

Pyth, 99 79 71 68 64 bytes
Pyth is very bad all right at making strings.  Or maybe I'm just bad getting better at golfing them.
jmj.[-yQ3@,k@,@,O"MC"\FgydQOc"MAFHMF"3Q>2ahydQ@" @"sIcdtQc2"(@@)

Can create the decorations MAF and HMF horizontally, and the decorations MF and CF vertically.
Try it online!

Ahh, good to see some character development in this story.

Vim, 118 bytes
Takes input as a buffer (e.g. a file with the number n as its contents).
"aDi()<Esc>@ai@<Esc>.xY@apddll<C-v>G$k3hr @=@a/2-1
j@=@a-2-@a%2
l:let r=abs(reltime()[1])%2
@=@a%2?r?"RJCJ":"3rT":"rFkr"."ML"[r]
<Esc>

Here it is with the unprintable control characters in xxd format:
0000000: 2261 4469 2829 1b40 6169 401b 2e78 5940  "aDi().@ai@..xY@
0000010: 6170 6464 6c6c 1647 246b 3368 7220 403d  apddll.G$k3hr @=
0000020: 4061 2f32 2d31 0a6a 403d 4061 2d32 2d40  @a/2-1.j@=@a-2-@
0000030: 6125 320a 6c3a 6c65 7420 723d 6162 7328  a%2.l:let r=abs(
0000040: 7265 6c74 696d 6528 295b 315d 2925 320a  reltime()[1])%2.
0000050: 403d 4061 2532 3f72 3f22 524a 434a 223a  @=@a%2?r?"RJCJ":
0000060: 2233 7254 223a 2272 466b 7222 2e22 4d4c  "3rT":"rFkr"."ML
0000070: 225b 725d 0a1b                           "[r]..

Try it online! (As it turns out, the V interpreter works fine for normal Vim code, too.)
Explanation
"aD                   " Delete the number and store it in @a
i()<Esc>              " Insert empty parentheses
@ai@<Esc>.x           " Insert @a '@' characters between the parentheses twice; delete 1
Y@apdd                " Copy the line and paste it @a times; delete 1
ll<C-v>G$k3hr<Space>  " Replace the inner area with spaces
@=@a/2-1<CR>j         " Go down @a/2-1 lines
@=@a-2-@a%2<CR>l      " Go right @a-2-@a%2 columns
:let r=reltime()[1]%2<CR>  " Get a random 1 or 0 based on the time (this may be OS-dependent)
@=@a%2?
   r?"RJCJ":"3rT"     " For odd @a, replace the next 3 characters with "JCJ" or "TTT"
  :"rFkr"."ML"[r]     " For even @a, replace this character with "F" and the above with "M" or "L"
<CR><Esc>

Wow, nice! I think this is the first non-deterministic vim answer I've seen! A couple thoughts: 1) When you put the input in "arguments" rather than "input", it predefines @a to arg1, @b to arg2, etc. but this is a V specific feature. This doesn't technically matter since you have "aD at the beginning, but I just thought I'd point it out. 2) You could take one byte off if you did dd@ap instead of Y@apdd

@DJMcMayhem dd@ap doesn't quite work alas.

dd@aP works, but then requires an additional j and an additional k down the line.

PHP, 342 292 249 185 178 176 bytes
for(;$i<$n=$argv[1];)$o.=str_pad("(@",2*$n-1," @"[$i++%($n-1)<1])."@)
";$p=F.[M,AM,R,MH][rand()&2|$d=$n&1];$f=$n*($n+$d)-2;for($i=2+$d;$i--;$f+=$d?:2*$n+2)$o[$f]=$p[$i];echo$o;

Call with php -r '<code>' <size>
history
Rev 1: initial version; all sizes (including tiny cakes), all decorations, all possible directions
Rev. 2: removed tiny cakes (-36 bytes), restructured decoration options, removed one decoration item (-21) and a single byte golf (-1).
Rev. 3: Down to four decorations; (-17), only horizontal for odd sizes (-18) plus minor golfing (-8).
Rev. 4: Thanks to Jörg for golfing down the "paint cake" part; he took off an amazing (-31).
Another -6 with my additional golfing, and -27 for using a single string instead of an array of strings.
Rev. 5: -7 bytes mostly thanks to Christallkeks
breakdown
This is getting slimmer by the hour. :)
// paint cake
for(;$i<$n=$argv[1];)$o.=str_pad("(@",2*$n-1," @"[$i++%($n-1)<1])."@)\n";

// add deco
$p=F.[M,AM,R,MH][rand()&2|$d=$n&1];
$f=$n*($n+$d)-2;
for($i=2+$d;$i--;$f+=$d?:2*$n+2)$o[$f]=$p[$i];

// output
echo$o;

for($i=0;$i<$n=$argv[1];$i++){$o[]=str_pad("(@",2*$n-1,!$i|$i==$n-1?"@":" ")."@)";}

@JörgHülsermann: Lots of thanks. I had to take a similar expression for !$i|$i==$n-1?"@":" "; the ternary would just not accept yours (on my machine), although it is correct.

try it for example on http://sandbox.onlinephpfunctions.com/

This saves you six bytes on the cake paint: for(;$i<$n=$argv[1];)$o.=str_pad("(@",2*$n-1," @"[$i++%($n-1)==0])."@)\n"; Also, it looks like you got "MAD" golfing your decos ;-)

Java 7, 399 349 bytes
Updated version with help from @Dodge and @Kevin Cruijssen:
void m(int n){int i=2,r=n%2,x=2*n,u=r+2,y=r*4+(int)(Math.random()*2)*u,z=y+u;String t="MFZJMAFHMF".substring(y,z);char[][]c=new char[n][x+1];while(i<x-1)c[0][i]=c[n-1][i++]=64;for(i=0;i<u;)c[(n-1)/2+(1-r)*i][r*(i-1)+n]=t.charAt(i++);for(i=0;i<n;){c[i][0]=40;c[i][1]=c[i][x-1]=64;c[i][x]=41;System.out.println(new String(c[i++]).replace('\0',' '));}}

void m(int n){String[]s={"MF","MAF","ZJ","HMF","LF","JCJ","RF","TTT","CF","MAF"};char[]d=s[((int)(Math.random()*5))*2+(n%2)].toCharArray(),c[]=new char[n][2*n+1];int i=2;while(i<2*n-1)c[0][i]=c[n-1][i++]='@';i=0;while(i<d.length)c[(n-1)/2+(1-(n%2))*i][(n%2)*(-1+i)+n]=d[i++];i=0;while(i<n){c[i][0]='(';c[i][1]=c[i][2*n-1]='@';c[i][2*n]=')';System.out.println(new String(c[i++]).replace('\0',' '));}}

Try it here!
The new version is much more optimized and got rid of the String array handling. Also as suggested, there are only 4 decorations now: 2 for even inputs (MF,ZJ) and 2 for odd inputs (MAF,HMF) which are combined into a single String.
Ungolfed:
void m(int n){
    int i=2,
    r=n%2,
    x=2*n,
    u=r+2, // length of the decoration string
    y=r*4+(int)(Math.random()*2)*u, // random starting index of string (0, 2, 4, 7)
    z=y+u; // exclusive end index of string (2, 4, 7, 10)
    String t="MFZJMAFHMF".substring(y,z);
    char[][]c=new char[n][x+1];
    while(i < x-1) {
        c[0][i]=c[n-1][i++]=64; // '@'
    }
    for(i=0; i<u;) {
        c[(n-1)/2+(1-r)*i][r*(i-1)+n]=t.charAt(i++); // Depending on even/odd, fills the center column/row respectively with the decoration
    }
    for(i=0; i<n;) {
        c[i][0]=40; // '('
        c[i][1]=c[i][x-1]=64; // '@'
        c[i][x]=41; // ')'
        System.out.println(new String(c[i++]).replace('\0',' ')); // Print all
    }
}

Thanks for the submission! Let me clarify, as a few users have missed it - not all decorations must be included. I have gone ahead and bolded this in the 'clarifications' section. Hopefully that will save you a few bytes! I believe you would still be able to use the same method to select decorations.

Haha, as far as Java golfing goes, he might as well include all of the decorations ;). +1, always, for anyone with the balls to whip out the Java-putter.

Why is "MAF" repeated?

@carusocomputing Very true. Just in case, though, I thought I'd mention it. Nice!

Thanks for your feedback :)  True, Java isn't very optimal for golfing, but it's pretty fun to do it :P. Maybe I could use the loops and initialization of the decoration char[] more efficiently and golf other things further. @Cyoce I duplicated MAF because then I have all decorations for an even input at indices 0,2,4,6,8 and all decorations for an odd input at indices 1,3,5,7,9. That makes it easier to calculate the random index for a given input. Math.random()*5 gives a random number from 0-4. *2 spreads it to 0,2,4,6,8. +n%2 adds 1 for odd inputs to get 1,3,5,7,9.

@QBrute can't you just do ((int)(Math.random()*10)) instead of  ((int)(Math.random()*5))*2 would save 1 byte :D

@QBrute actually you can remove the outer parenteses to save another 2 bytes s[(int)(Math.random()*10)+n%2] instead of s[((int)(Math.random()*5))*2+(n%2)]

@Dodge right, the outer two parenthesis can be removed. And for your other comment, no i can't do that because Math.random()*10 and (Math.random()*5)*2 are two different operations. The first will give you a random number in the range of 0-9, whereas the second version will give you a random number from 0,2,4,6,8

You can save 3 bytes: (-1+i) -> (i-1); i=0;while(i<d.length) -> for(i=0;i<d.length;); i=0;while(i<n){ -> for(i=0;i<n;){.

And 4 more bytes by changing '@' to 64; '(' to 40 and ')' to 41. Also, as for the duplicated "MAF", you're also allowed to just have two decorations of length 2 and two of length 3.

@KevinCruijssen thanks for your input. I've updated my code.

C, 233 Bytes
Should be able to golf this down a bit from here...
A="HMFMAFCF";i,j,k,t;f(n){t=time();char*S=n&1?t&1?A:A+3:t&1?A+1:A+6;for(;i<n;i++,puts(")"))for(j=0,k=2*n-1,putchar(40);j<k;putchar(0==i*j|i==n-1|j==k-1?64:n&1&i==n/2&j>n-3&j<n+1?*S++:n&1?32:(i==n/2-1|i==n/2)&j>n-2&j<n?*S++:32),j++);}

Great challenge, this was difficult and ugly to code.
Run with this main func;
main(c,v)char**v;
{
    f(atoi(v[1]));
}

Batch, 386 bytes
@echo off
set/pn=
set f=HMAC
set/ao=n%%2,u=n/2,l=h=u+1,d=%random%%%2*2+1
if %o%==1 set/al=u=0,d/=2
set c=
for /l %%i in (4,1,%n%) do call set c= %%c%%
call:l %n%
for /l %%i in (2,1,%n%) do call:l %%i
exit/b
:l
set s=
if %1==%h% call set s=%%f:~%d%,2%%F
if %1==%u% call set s= %%f:~%d%,1%%
if %1==%l% set s= F
set s=(@%c%%s%%c%@)
if %1==%n% set s=%s: =@%
echo %s%

Will only output HMF, MAF, MF or CF as appropriate. Note: certain lines end in white space. Variables:

n Input parameter (read from STDIN)
f Decoration prefixes (suffix F is implied)
o Oddness of n (only used once, but if statements don't accept expressions)
l Row of the upper vertical character, or 0 for a horizontal decoration
u Row of the lower vertical character, or 0 for a horizontal decoration
h Row of the horizontal decoration (gets overwritten by a vertical decoration)
d Index of decoration in decoration prefix (0/1 for horizontal or 1/3 for vertical)
c String of n-3 spaces
s Output string for each row
%1 Row number, but set to n for the first row too, so that both first and last rows use @s instead of spaces.

Ruby 2.3.1, 449 265 245 233 230 characters
Seems like there should be a ruby answer, so here is a ruby answer. It's really not that clever, Hopefully someone else here will be more clever ;)
Golfed version:
def m(n)
d,s=n.odd?? [[%w{MAF HMF}.sample],n/2]:[%w{RF LF}.sample.chars,(n-2)/2]
r=->f{l=f.size;q=($i-l)/2;($c=' '*$i)[q...l+q]=f;puts "(@#$c@)"}
$i=2*n-1;a='@'*$i
r[a]
(1..n-2).map{|x|(s...s+d.size)===x ?r[d[x-s]]:r['']}
r[a]
end

Golfing tricks:

replace method declaration with a stabby string interpolation of
$globals doesn't need #{global}, only #$global
=== for ranges is shorter than .covers?

Readable version
def row(inner_width, fillchar='')
  padding = ( inner_width - fillchar.size) / 2
  (center =(' ' * inner_width))[padding...fillchar.size+padding]=fillchar
  puts "(@"+center+"@)"
end

def mooncake(n)
  decoration = n.odd?? [%w{ MAF HMF JCJ TTT }.sample] : %w{ ZJ LF RF CF }.sample.chars
  start_row = n.odd?? (n/2) : (n - 2) / 2
  inner_width = 2 * n - 1
  row(inner_width,'@'*inner_width)
  (1...(n-1)).each do |row|
    if (start_row ... start_row + decoration.size).include? row
      row(inner_width,decoration[row - start_row])
    else
      row(inner_width)
    end
  end
  row(inner_width,'@'*inner_width)
end

Testing
mooncake(3)
mooncake(4)
mooncake(5)
mooncake(6)

I reimplemented w/o using the array, seems like everyone is doing that.

I was bored ... here are two more versions:
PHP, 193 bytes
function p($s){global$n;return"(@".str_pad($s,2*$n-3,$s?" ":"@",2)."@)
";}$p=[M,MA,R,HM][rand()&2|1&$n=$argv[1]];echo p(""),$e=str_repeat(p(" "),($n+$n%2)/2-2),$n&1?p($p.F):p($p).p(F),$e,p("");

a port of Lmis´ answer
PHP, 191 bytes
for($p=[M,MA,R,HM][rand()&2|1&$n=$argv[1]].F;$i<$n*$w=2*$n+1;$i++)echo($x=$i%$w)?$w-1-$x?($y=$i/$w|0)%($n-1)&&1-$x&&$w-2-$x?$p[$n&1?$n>>1!=$y?9:$x-$n+1:($n-$x?9:$y-$n/2+1)]?:" ":"@":")
":"(";

printing the cake character by character in a single loop
breakdown
for(
    $p=[M,MA,R,HM][rand()&2|1&$n=$argv[1]].F;   // pick decoration
    $i<$n*$w=2*$n+1;$i++)       // loop $i from 0 to $n*width-1:
echo                                // print ...
    $w-1-($x=$i%$w)                 // 1. not last column
        ?$x                         // 2. not first column
            ?
                ($y=$i/$w|0)%($n-1) // 3. not first or last line
                && 1-$x%($w-3)      // and not second or (width-2)th column
                ?$p[$n&1
                    ?$n>>1!=$y?3:1+$x-$n
                    :($n-$x?3:1+$y-$n/2)
                ]   ?               // 4. decoration character
                    :" "            // 4. else: blank
                :"@"                // 3. else: "@"
            :"("                    // 2. else: "("
        :")\n"                      // 1. else: ")"+newline
    ;

Python 3, 318 301 297 285 272 bytes
Knocked off 17 bytes with the help of DJMcMayhem
Knocked off 4 bytes thanks to mbomb007
Knocked off another 12 bytes thanks to DJMcMayhem
Knocked off another 13 bytes thanks to mbomb007
My first golf ever, so it's not all that great. I used: aliasing math.ceil as y and str.format as z, nesting formats, single line imports, lambda, and bitwise operation plus some other things to get this like it is.
def f(n):import random,math;y=math.ceil;z=str.format;i=y(2*n-5>>1);j=y(n-3>>1);return z("{a}{}{a}",z("{d}(@{}{b}F{c}@)\n{e}"," "*i,b=random.sample(["L","R"],1)[0],c=" "*(2*n-5-i),d=z("(@{}@)\n"," "*(2*n-3))*j,e=z("(@{}@)\n"," "*(2*n-3))*(n-3-j)),a=z("({})\n","@"*(2*n-1)))

Ungolfed version (separated imports, no aliases, and no bitwise operation):
def f(n):
    import random;
    import math;
    return "{a}{}{a}".format(
        "{d}(@{}{b}F{c}@)\n{e}".format(
            " "*(math.ceil((2*n-5)/2)),
            b=random.sample(["L","R"],1)[0],
            c=" "*((2*n)-(5+math.ceil((2*n-5)/2))),
            d="(@{}@)\n".format(" "*(2*n-3))*math.ceil((n-3)/2),
            e="(@{}@)\n".format(" "*(2*n-3))*(n-(3+(math.ceil((n-3)/2))))),
        a="({})\n".format("@"*(2*n-1)))

Interestingly, using the non-bitwise version of this still produces correct output, however, the output is different:
Non-Bitwise:
(@@@@@@@)
(@     @)
(@  LF @)
(@@@@@@@)

Bitwise:
(@@@@@@@)
(@ LF  @)
(@     @)
(@@@@@@@)

you can move the imports out of the function and change them to from ... import* type imports to save some bytes

Nice answer, and welcome to the site! A couple tips: 1. lambda functions are shorter, and 2. you could do import math;y=math.ceil to take two bytes off. This would give you import random;import math;y=math.ceil;lambda n:"{a}{}{a}".format("{d}(@{}{b}F{c}@)\n{e}".format(" "*(y((2*n-5)/2)),b=random.sample(["L","R"],1)[0],c=" "*((2*n)-(5+y((2*n-5)/2))),d="(@{}@)\n".format(" "*(2*n-3))*y((n-3)/2),e="(@{}@)\n".format(" "*(2*n-3))*(n-(3+(y((n-3)/2))))),a="({})\n".format("@"*(2*n-1))) which is 13 bytes shorter.

@DJMcMayhem Thanks a lot! I updated my answer.

Glad I could help! One other thing you could probably do is alias to format since you call it a lot. Problem is, I don't exactly know how to alias to a member function (like str.format) so you'd have to experiment a little. I'm not positive it would be shorter though.

n-(3+(y((n-3)/2))) can be shortened to n-y(n-3>>1)-3. (n-3)/2 is n-3>>1. (2*n)-(5+y((2*n-5)/2)) is 2*n-y(2*n-5>>1)-5.

@DJMcMayhem This is the best that I could do with using an alias import random,math;y=math.ceil;z=lambda s,*u,**w:s.format(*u,**w);lambda n:z("{a}{}{a}",z("{d}(@{}{b}F{c}@)\n{e}"," "*(y((2*n-5)/2)),b=random.sample(["L","R"],1)[0],c=" "*((2*n)-(5+y((2*n-5)/2))),d=z("(@{}@)\n"," "*(2*n-3))*y((n-3)/2),e=z("(@{}@)\n"," "*(2*n-3))*(n-(3+(y((n-3)/2))))),a=z("({})\n","@"*(2*n-1))) it's unfortunately a little longer, perhaps there's an easier way to do it? I only save 5 bytes per format and I used 6, so I need a way to alias format that is 29 or less bytes.

Well, you could do f=str.format, but you'll have to modify some things for it to work right. See this tip

@mbomb007 thanks a lot! I was able to knock off four bytes but it slightly altered the output (still correct, just different)

@DJMcMayhem Where was that post when I was looking for an hour and a half... thank you, that worked beautifully.

@L.Steer Did you even make my suggested changes? Read them and make them again, since you didn't.

@mbomb007 I did, and then made another change but apparently it was to a different version of the code I had. It's in there now, I've been making lots of edits because it started off pretty sloppy. Thanks again!

You only made one of the 3 changes I suggested. Look at all 3 changes closely and all the parentheses I removed.

@mbomb007 I'm so sorry, I wasn't reading carefully at all. I've made the rearrangements and also stored the results of the ceiling functions as variables so I was able to shave off 20 bytes! Hopefully I haven't missed other suggestions, but I wouldn't be surprised at this point...

You can't store those as variables, as n isn't defined outside the lambda. If you use a function with def you can store variables inside, but not in a lambda.

Alright, that's going to be my last edit then, regardless of what modifications I can make. I decided to switch to using a function so that I could store the variables (I'm not used to working with lambdas so that was eye opening for me). This was a very educational exercise, thanks to the both of you for your help.

Nice work! I am glad you got something out of this exercise :) However, I would like to clarify that the decoration must be centered to fit the challenge specifications. Whether or not you decide to change your code to reflect this - can I ask that you keep the current code in your post too? Good effort worth keeping, even if it neglects one of the rules.

C# 448 bytes
Golfed:
var v=n%2==0;int l=n+n-3,h=n-2,e=v?0:1,c=e+2;var c2=v?"MFZJLFRFCF":"MAFHMFJCJTTT";var r=new Random().Next(3+e);var f=new String(c2.Skip(c*r).Take(c).ToArray());var mc="";for (var i=0;i < h;i++) {var x="";if (!v && i==((h / 2))) { x=f;} else if (v && ((i==h / 2) || (i==(h/2)-1))) { x +=f[i%2==1?0:1];} var es=x.PadLeft((l/2)+1+e,' ').PadRight(l,' ');mc +="(@"+es+"@)\n";}var b="("+"".PadLeft(l+2, '@')+")";mc=b+"\n"+mc+ b; Console.WriteLine(mc);

Test it here
Ungolfed:
        var v = n % 2 == 0;
        int l = n + n - 3, h = n - 2, e = v ? 0 : 1, c = e + 2;
        var c2 = v ? "MFZJLFRFCF" : "MAFHMFJCJTTT";
        var r = new Random().Next(3 + e);
        var f = new String(c2.Skip(c * r).Take(c).ToArray());
        var mc = "";
        for (var i = 0; i < h; i++)
        {
            var x = "";
            if (!v && i == ((h / 2)))
            {
                x = f;
            }
            else if (v && ((i == h / 2) || (i == (h / 2) - 1)))
            {
                x += f[i % 2 == 1 ? 0 : 1];
            }
            var emptySpace = x.PadLeft((l / 2) + 1 + e, ' ').PadRight(l, ' ');
            mc += "(@" + emptySpace + "@)\n";
        }
        var b = "(" + "".PadLeft(l + 2, '@') + ")";
        mc = b + "\n" + mc + b;
        Console.WriteLine(mc);