text:
Calculate the vector component
Challenge
Assume two vectors \$\mathbf{a} = (a_1,a_2,\cdots,a_n)\$ and \$\mathbf{b} = (b_1,b_2,\cdots,b_n)\$ are given in an \$n\$-dimensional space, where at least one of \$b_1,\cdots,b_n\$ is nonzero. Then \$\mathbf{a}\$ can be uniquely decomposed into two vectors, one being a scalar multiple of \$\mathbf{b}\$ and one perpendicular to \$\mathbf{b}\$:
$$
\mathbf{a} = \mathbf{b}x + \mathbf{b^\perp}\text{, where }\mathbf{b^\perp} \cdot \mathbf{b}=0.
$$
Given \$\mathbf{a}\$ and \$\mathbf{b}\$ as input, find the value of \$x\$.
This can be also thought of as the following: Imagine a line passing through the origin and the point \$\mathbf{b}\$. Then draw a perpendicular line on it that passes through the point \$\mathbf{a}\$, and denote the intersection \$\mathbf{c}\$. Finally, find the value of \$x\$ that satisfies \$\mathbf{c}=\mathbf{b}x\$.
You can use an explicit formula too (thanks to @xnor), which arises when calculating the projection:
$$
x=\frac{\mathbf{a} \cdot \mathbf{b}}{\mathbf{b} \cdot \mathbf{b}}
$$
Standard code-golf rules apply. The shortest code in bytes wins.
Example
Here is an example in 2D space, where a=(2,7) and b=(3,1). Observe that (2,7) = (3.9,1.3) + (-1.9,5.7) where (3.9,1.3) is equal to 1.3b and (-1.9,5.7) is perpendicular to b. Therefore, the expected answer is 1.3.

Test cases
a         b          answer
(2,7)     (3,1)      1.3
(2,7)     (-1,3)     1.9
(3,4,5)   (0,0,1)    5
(3,4,5)   (1,1,1)    4
(3,4,5)   (1,-1,-1)  -2
(3,4,5,6) (1,-2,1,2) 1.2

Will the values of the input vectors always be integers?

@Noodle9 No, it may have non-integers.

Can we take the dimension $n$ as additional argument?

@KevinCruijssen No, unless you're using pointer+length input.

APL (Dyalog Unicode), 1 byteSBCS
⌹

Check all test cases! When used dyadically, X ⌹ Y solves the least squares* system \$Ya = X\$ for a result \$a\$ of the appropriate shape, e.g.:

if \$Y\$ is a matrix and \$X\$ is a vector, we try to solve a linear system of equations.
if \$Y\$ and \$X\$ are matrices, we compute \$Y\$'s (pseudo-)inverse and multiply it on the left of \$X\$.
when both \$X\$ and \$Y\$ are vectors, the least squares formulation reduces to what we want, namely

$$\frac{X \cdot Y}{||Y||^2}$$
*the least squares system \$Ya = X\$ can be understood as "what should \$a\$ be such that \$Ya\$ is as close as can be to \$X\$?", where closeness is measured with the usual L2 distance.

We have a winner. I very much doubt any language can do this in 0 bytes.

If I open a file and I see that thing in it, I will mark it as virus.

@darksky a couple of months ago I would've done the exact same thing

Haskell, 33 32 bytes
-1 byte thanks to @xnor!
(!)b=sum.zipWith(*)b
a#b=a!b/b!b

Try it online!

Coconut, 35 bytes
(a,b)->p(a,b)/p(b,b)
p=sum..map$(*)

Try it online!

Save a byte by making definition of ! a bit less pointfree: (!)v=sum.zipWith(*)v

R, 24 bytes
function(a,b)a%*%b/b%*%b

Try it online!

lm(a~b-1) does slightly better.

@Xi'an that's great, and it's also a principally different approach, so I'd suggest you to post it as a separate answer.

Python 3 + numpy, 20 bytes
lambda a,b:a@b/(b@b)

Try it online!

MATL, 2 bytes
Y\

Try it online!
Least squares approach such as used in the APL answer.

Fortran >= 95, 66 bytes
Taking advantage of implicit typing for the return type.
function x(a,b)
real a(:),b(:)
x=dot_product(a,b)/norm2(b)**2
end

Jelly, 6 5 bytes
ḋ`÷@ḋ

Try it online!
Simple translation of the given formula. Takes \$\mathbf{b}\$ as the left argument and \$\mathbf{a}\$ as the right argument.
ḋ        The dot product of b and
 `       itself,
  ÷@     dividing
    ḋ    the dot product of b and a.

Charcoal, 21 18 bytes
Ｆ²⊞υΣＥＡ×κ§θλＩ∕⊟υ⊟υ

Try it online! Link is to verbose version of code. Takes inputs in the order b, a. Explanation:
Ｆ²

Repeat twice...
⊞υΣＥＡ×κ§θλ

Input a vector, take its dot product with b and push the result to the predefined empty list.
Ｉ∕⊟υ⊟υ

Retrieve the dot products and take their quotient.

The previous version was lost because I happened to slip under the grace edit period by a couple of seconds, but you didn't miss much, just a one-byte golf from taking inputs in reverse order and separate a two-byte golf.

10 bytes using the newer version of Charcoal on ATO: Ｉ∕Σ×θηΣ×ηη Attempt This Online Link is to verbose version of code. Does not take inputs in reverse order.

C (gcc), 84 74 73 bytes
Saved 10 bytes thanks to dingledooper!!!
Saved a byte thanks to ceilingcat!!!
float f(a,b,n)float*a,*b;{float x,y;for(;n--;y+=*b**b++)x+=*a++**b;x/=y;}

Try it online!
Inputs two pointers to vectors \$a,b\$ and their dimension \$n\$ and returns their component..
Uses given formula:
$$x = \frac{a_0\cdot b_0 + a_1\cdot b_1 + \dots + a_{n-1}\cdot b_{n-1}}{b_0^2 + b_1^2 + \dots + b_{n-1}^2}$$

05AB1E, 6 bytes
*OInO/

Try it online or verify all test cases.
Implements the given formula:
$$x = \frac{a_1\times b_1 + a_2\times b_2 + \dots + a_n\times b_n}{b_1^2 + b_2^2 + \dots + b_n^2}$$
Explanation:
*       # Multiply the values at the same indices in the two (implicit) input-lists
 O      # Sum this list
  I     # Push the second input-list again
   n    # Square each value
    O   # Take the sum of that
     /  # And divide the two values
        # (after which the result is output implicitly)

Wolfram Language (Mathematica), 9 bytes
#.#2/#.#&

Try it online! Pure function. Takes b followed by a as input and returns a rational number as output. It just directly uses Mathematica's notation for the dot product.

[R], 22 bytes
Taking advantage of a resident regression function, lm
function(a,b)lm(a~b-1)

Try it online!

Java 10, 84 74 bytes
a->b->{float A=0,B=0;int i=0;for(var t:b){A+=a[i++]*t;B+=t*t;}return A/B;}

Try it online.

Japt v2.0a0, 9 bytes
í*V x÷Vx²

Try it

authors: Xi'an ні війні

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


text:
Validate Blokus Board
Blokus is a board game in which players take turns placing pieces on a \$ n \times n \$ square grid. In this version of the game, there will be just one person playing. The person is given \$ 21 \$ unique polyominoes, ranging from \$ 1 \$ to \$ 5 \$ tiles each. They then proceed to place down a subset of the pieces onto the board. After the pieces have been placed, it is your job to determine whether it could be a valid Blokus board.

There are \$ 3 \$ key rules for placing down pieces, which must be followed:
\$ 1. \$ The first piece being placed must touch one of the four corners of the board
\$ 2. \$ After the first piece, each subsequent piece must not contain a tile that is adjacent to another piece in any of the four cardinal directions (not including diagonals)
\$ 3. \$ After the first piece, each subsequent piece must contain at least one tile that is diagonally adjacent to another piece, (that is, all pieces should form a single connected component which are connected only by corners touching)
Task
The task is to determine, given an \$ n \times n \$ square grid, whether it could be a valid Blokus board. A Blokus board is considered valid if it obeys the \$ 3 \$ rules given above.
In addition, you can assume that the board will consist only of the \$ 21 \$ valid Blokus pieces. However, you may not assume that there are no duplicates. A board which contains a duplicate is automatically considered invalid.
Very Important
You may notice that sometimes a single board can have multiple orientations of the pieces. For example,
...
.XX
XXX

might be a single P piece, but it could also be a V3 piece directly adjacent to a 2 piece, among other things. If this is ever the case, you should output a Truthy value if any of these orientations match. So in the above example, it would return true, because while it could be a V3 and a 2 piece, which breaks Rule 2, it could also be a single P piece, making it a valid board.
Clarifications

The board will be inputted as a grid of two distinct values, denoting whether a given tile is occupied by a polyomino
The input can be taken in any reasonable format (e.g. 2D array, flattened string, list of coordinates + dimensions)
The pieces can be rotated or reflected before placing on to the board
Not all the pieces are required to be placed down to be considered a valid position

Test Cases
Truthy
('X' for occupied, '.' for unoccupied)

.X.
.XX
X..

XX.X
XXX.
...X
..XX

.....
.....
.....
.....
.....

......
......
......
......
......
X.....

X....XXX.
X..XX.X..
X..XX..X.
X.....XXX
X.XX.X.X.
.X.XX....
.X..X.XXX
.X.X.X...
.X.XXX...

Falsey
('X' for occupied, '.' for unoccupied)

Invalid configuration, there is no such piece, unless two pieces are joined to
look as one (e.g. 'L4' piece is directly adjacent to '2' piece), which would
break Rule 2.
XXX
X.X
X..

Invalid, since a valid board can contain no duplicates.
X....
X....
X....
X....
.XXXX

Invalid configuration. Even though the pieces are all valid, it doesn't start in
one of the four corners, which breaks Rule 1.
.....
..X..
.XXX.
.X...
..X..

Invalid configuration. All pieces are valid and are not adjacent horizontally
or vertically, however they are disjoint (they do not form a single chain, which
breaks Rule 3).
X...XX
X.X.XX
X.X..X
..XXX.
.....X
X..XXX

Invalid configuration. The two components are disjoint.
.XX..
X....
X.X..
X..XX
X..XX

Invalid configuration. It breaks Rule 1, 2, and 3 (board may be portrayed as an
'L4' piece at the bottom, and an 'O' and a '2' piece at the top).
.....
.XXXX
...XX
.X...
.XXX.

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

all pieces should form a single chain which are connected only by corners touching A chain? That is, if we make a connection graph, there are no vertices with degree above 2 (that is, no branching), and no loops allowed.

@Abigail Is that the graph theory definition of chain? Then I suppose connected component is more accurate.

Can we take input as a list of coordinates of Xs? e.g. [(1,0),(1,1),(2,1),(0,2)]. This would also require passing n

@fireflame241 Yes, I've added it to the question.

Wow, great challenge, but it seems extremely difficult to me.

Btw, I would suggest changing the wording from "determine...whether it is a valid Blokus board" to "determine...whether it could be a valid Blokus board". Essentially we're saying that you don't know what pieces are present on each of the X's, but return true if it's possible that the configuration is valid.

@SteveBennett Thanks for the suggestion.

For clarity, I'd also remove all the stuff about multiple players taking turns, and who wins. We're just focusing on the single-player use case here, so it's a bit confusing and distracting.

@Arnauld Added the suggested test case.

Python 2, 446 422 385 384 bytes
-1 byte thanks to @ovs
l=len
A=abs
s="""def v(O,N):
 def c():
 qp:
    qp:
        if(i!=j)*any(A(t-T)==1qiqj):i+=j;p.remove(j);c();return
 p=[[a]qO];c();r=C=p[:1];i=[sum(A(b-a)*A(c-b)qPqPqP)qp];N-=1
qC:
  if l(o)>5:r=0
 qp:C+=[P]*(1-all(A(a-b)-2**0.5qoqP)-(P in C))
 print(l(p)-l(C)+l(i)-l(set(i))==0)*any(k in Oq[0,N*1j,N+N*1j,N])*r,p>[]"""
exec eval("s"+".replace('q',' for %s in ',1)"*14%tuple("ijtTaabcPoPabk"))

The output format is a bit strange: it prints more than 7 characters for truthy output, and 7 or fewer characters for falsey output (7 characters is the length of "[] True". This may be stretching it, so the p>[] can be replaced by if p!=[] else 1 for +11 characters to give more traditional truthy/falsey output.
The input is a list of coordinates given as complex numbers, along with the dimension n.
Try it online!
All testcases
The invariant may be the most interesting part. Since it must be conserved on rotations and reflections, distance between corresponding tiles is just about the only thing that stays constant. Also, I could not rely on the order that the tiles are listed in the piece. Using the product/sum of distances between every tile led to collisions, but using triples of tiles worked well.
I used for _ in fourteen times (wow), so the exec/eval saves 37 bytes.
Ungolfed:
def invariant(piece):
    inv=1
    for a in piece:
        for b in piece:
            for c in piece:
                inv+=abs((b-a)*(c-b))
    return inv

def valid(occupied,n):
    # convert list of rows into coordinates of Xs
    if not len(occupied):
        return True
    # generate list of pieces (this takes care of rule #2)
    pieces = [[a] for a in occupied]
    def consolidate():
        for i in pieces:
            for j in pieces:
                # merge two pieces if they share an edge
                if i!=j and any(abs(tile1-tile2)==1 for tile1 in i for tile2 in j):
                    i += j
                    pieces.remove(j)
                    # this repeats consolidate until no change (nothing left to combine)
                    consolidate()
                    return
    consolidate()
    # get a connected component of pieces (for rule #3)
    connected = [pieces[0]]
    for connected_piece in connected:
        # eventually every piece should be connected if the board is otherwise valid, so
        # we can check for valid-size pieces in this outer loop
        # all polyominoes with at most 5 tiles are valid
        if len(connected_piece) > 5:
            return False
        for piece in pieces:
            if any(abs(a-b)==abs(1+1j) for a in connected_piece for b in piece) and piece not in connected:
                connected += [piece]
    # check that all pieces are only used once
    ids = [invariant(piece) for piece in pieces]
    used_once = len(ids) == len(set(ids))
    nm = n-1
    rule_1_met = any(k in occupied for k in [0, nm*1j, nm+nm*1j, nm])
    return used_once and rule_1_met and len(pieces) == len(connected)

Great first answer, looking forward to having this golfed a bit more!

2**.5 is a little shorter than A(1+1j).

@ovs Good suggestion. I thought A(a-b)**2-2 would work and be 2 bytes shorter still, but it seems to break everything

I also tried that, but there are some issues with floating point inaccuracy here, (2**.5)**2 gives me 2.0000000000000004 in the Python REPL.

And you don't need the 0 in 2**0.5.

JavaScript (ES7),  344 330 328  326 bytes
Takes a binary matrix as input. Returns 0 or 1.
m=>[-1,C=E=I=0,1,2,1,4].map(Z=t=>(m=m.sort(_=>t-3).map((r,y)=>r.map((_,x)=>m[x][y])),C|=!!m[0][0],g=(X,Y)=>m.map((r,y)=>r.map((v,x)=>(q=(x-X)**2+(y-Y)**2,t&1?v>0:v<0)?~t?1/X?q-1||g(x,y,S.push(x-H,y-V),r[x]=t?-v:I,n++):E|=Z[g(H=x,V=y,K=r[x]=t?-v:++I,S=[d=n=1]),S]-(Z[S]=K*K)|n>5|v==1:q<3|!I&&g(x,y,r[x]=-1,I=1):0)))())|I<2|C&!E

Try it online!
How?
About the 2nd rule
The 2nd rule is implicitly enforced if we:

Assume that adjacent tiles always belong to the same piece.
Make sure that all pieces are made of at most 5 tiles.
Make sure that there are no duplicate pieces (either rotated or reflected).

Main algorithm
Our algorithm works with 6 iterations.
The pieces are identified by flood-filling the occupied tiles of the grid.
During the first iteration, we look for the first occupied tile as a starting point and flood-fill in all directions (including diagonals) with \$-1\$. If a piece is not connected to the other ones, it will still be filled with \$1\$'s after this process, as the secluded red tile in the example below.
During the second iteration, each piece is renumbered with a distinct ID, starting at \$2\$.
Example:
(ignoring the transformations that are described in the next paragraph)
$$\begin{pmatrix}
1&1&0&1\\
1&1&1&0\\
0&0&0&1\\
\color{red}1&0&1&1
\end{pmatrix}\rightarrow
\begin{pmatrix}
-1&-1&0&-1\\
-1&-1&-1&0\\
0&0&0&-1\\
\color{red}1&0&-1&-1
\end{pmatrix}\rightarrow
\begin{pmatrix}
2&2&0&3\\
2&2&2&0\\
0&0&0&4\\
\color{red}1&0&4&4
\end{pmatrix}
$$
During the next iterations, only the sign of the IDs is changed.
Transformations
At each iteration, the matrix is either rotated or reflected in such a way that 2 duplicate pieces are guaranteed to eventually appear with the same shape at some point.

For each piece, we build a shape key consisting of a flatten list \$S\$ of \$(dx,dy)\$ values. It describes the positions of the tiles, using the top-left one as the origin. The keys are stored in the object \$Z\$.
There is a duplicate if we encounter the same key at any iteration for two distinct piece IDs.
Flags and final result
The flag \$E\$ (for error) is set if:

a duplicate is found
or a piece is made of more than 5 tiles
or there's at least one tile which is still marked as \$1\$, meaning that a piece is not connected to the other ones

At each iteration, we test whether the tile at \$(0,0)\$ is occupied and set the flag \$C\$ (for corner) if it is. Because all rotations are tried, it is guaranteed to be set if there's at least one piece in any corner.
Because an empty board is valid although it has no corner, we also need the variable \$I\$, which is the number of pieces + 1.
The final result is given by:
$$(I<2)\text{ or }\big(C\text{ and }(\operatorname{not} E)\big)$$

This gives an incorrect result for four tiles in two disjoint pairs.

@Neil You are of course right. Fortunately, I was able to save 2 bytes while fixing that.

J, 134 130 bytes
Takes the dimensions and a list of points. I'm not sure if this is the best approach, but it is shorter then a quick matrix attempt.
(((140*/@:>#"1)*[-:~.)@((5 2$0 0,i:1)&n)*2>[:#(,/,"0/~i:1)&n=.]/:~@,@:(-/~)/.~[:+./"2@#~^:_]e./"2+"1/~)@[*(+/@e.~0,3 2$0,<:)+0=#@[

Try it online!
How it works
We check five things:

empty list OR all of …
corner is in the points
all points are connected to each other via 8 directions
all groups that are connected to each other via 4 directions have max length of 5
the groups of 4 are unique

Most components and the combination of them can probably be golfed further. The most interesting part will be the uniqueness check: it calculates all differences between points and sorts them, flattened down. So 1 2, 2 2 -> 1 0, _1 0 -> _1 0 0 1. Not sure if this would be enough for all polyominoes, but for up to length 5 it seems to work.
A rough ungolfed version looks like this:
points=. 4 2 $ 0 1 , 1 1 , 1 2 , 2 0    NB. input
dims=. 3 3                              NB. input
empty=. 0=# points                      NB. 1
corner=. points (+/@e.~0,3 2$0,<:) dims NB. 2
dir8=. ,/,"0/~i:1                       NB. the 4 directions
dir4=. 5 2$0 0,i:1                      NB. the 8 directions
borders=. ]e./"2+"1/~                   NB. connection matrix: 1 iff. a borders b
expand=. +./"2@#~^:_                    NB. repeat in the matrix:
                                            if a<->b and b<->c then a<->c
group=. ] <./~ expand@borders           NB. partitions points to groups
                                            based on connection matrix
con8=. (2>[:#dir8&group) points             NB. 3
con4=. ([:*/6>#&>) (dir4 group points)      NB. 4
forms=. (/:~@,@:(-/~)&>) (dir4 group points)
unique=. (-:~.) forms                       NB. 5
f=. empty + corner * con4 * con8 * unique

Charcoal, 231 213 bytes
ＷＳ⊞υιυ≔⟦⟧ζ≔⟦⟧θ≔⟦⁰⊖Ｌυ⟧ηＦηＦηＦ⁼X§§υικ⊞θ⟦ικ⟧Ｗθ«≔…θ¹θＦθ«Ｊ⊟κ⊟κ¿⁼XＫＫ«↓#Ｆ⁴«Ｍ✳⊕⊗λ⊞θ⟦ⅉⅈ⟧»»»≔Φ⪪⭆ＫＡ⁼#κＬυΣκθＵＭθ✂κ⌊Ｅθ⌕μ1⊕⌈Ｅθ⊟⌕Ａμ1≔⟦⟧ηＦ⁴«⊞ηθ≔⮌θθ⊞ηθ≔Ｅ§θ⁰⭆θ§νμθ»⊞ζ⌊ηＵＭＫＡ⎇⁼#κ*κ≔⟦⟧θＦ⌕ＡＫＡX«Ｊ﹪κＬυ÷κＬυ¿№ＫＭ*⊞θ⟦ⅉⅈ⟧»»¿№ＫＡX⎚«⎚¬⊙ζ∨⊖№ζι‹⁵Σ⪫ιω

Try it online! Link is to verbose version of code. Outputs a Charcoal boolean, i.e. - for valid, nothing if invalid. Explanation:
ＷＳ⊞υιυ

Copy the board to the canvas.
≔⟦⟧ζ

Start with no pieces discovered.
≔⟦⟧θ

Start with no connected squares to check.
≔⟦⁰⊖Ｌυ⟧ηＦηＦη

Check the corners.
Ｆ⁼X§§υικ

If there is a piece in this corner, then...
⊞θ⟦ικ⟧

add that to the list of connected squares.
Ｗθ«

Repeat while there is at least one connected square.
≔…θ¹θ

Take the first square.
Ｆθ«Ｊ⊟κ⊟κ¿⁼XＫＫ«↓#Ｆ⁴«Ｍ✳⊕⊗λ⊞θ⟦ⅉⅈ⟧»»»

Perform a flood fill to complete this piece.
≔Φ⪪⭆ＫＡ⁼#κＬυΣκθＵＭθ✂κ⌊Ｅθ⌕μ1⊕⌈Ｅθ⊟⌕Ａμ1

Represent the piece as a binary matrix (using strings of 0s and 1s originally because Charcoal apparently can't reverse a binary array but it turns out that strings allow me to save another byte anyway) and extract the minimum enclosing rectangle.
≔⟦⟧ηＦ⁴«⊞ηθ≔⮌θθ⊞ηθ≔Ｅ§θ⁰⭆θ§νμθ»

Generate all the rotations and reflections of the piece.
⊞ζ⌊η

Add the minimum to the list of discovered pieces.
ＵＭＫＡ⎇⁼#κ*κ

Change the piece character from # to *.
Ｆ⌕ＡＫＡX«Ｊ﹪κＬυ÷κＬυ¿№ＫＭ*⊞θ⟦ⅉⅈ⟧»

Find all Xs that are adjacent to a *.
»¿№ＫＡX⎚

If there are any Xs left then they were disconnected so just clear the canvas.
«⎚¬⊙ζ∨⊖№ζι‹⁵Σ⪫ιω

Output a - only if all the discovered pieces are unique and have no more than 5 tiles.

source: Stack Exchange

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

sort: votes


text:
Generate self-avoiding loops of a specific length
This question is a sequel to this one, working in the opposite direction.
For a reminder of terminology, the letters L, R, U, and D represent one-unit movement of a robot on the coordinate plane in the directions left, right, up, and down respectively. Given a positive even integer n, generate and print all sequences of L, R, U, and D of length n that result in a closed loop that does not intersect itself. In other words, when the robot follows the instructions in the sequence of letters, it must visit a new cell with every movement until it completes the loop and returns to the original cell.
Any of the generally accepted output formats for arrays and strings are allowed. The elements printed must be in alphabetical order. It can be assumed that the input is always a positive even integer.
Test cases

2 -> {"DU", "LR", "RL", "UD"}
4 -> {"DLUR", "DRUL", "LDRU", "LURD", "RDLU", "RULD", "ULDR", "URDL"}
6 -> {"DDLUUR", "DDRUUL", "DLLURR", "DLUURD", "DRRULL", "DRUULD", "LDDRUU", "LDRRUL", "LLDRRU", "LLURRD", "LURRDL", "LUURDD", "RDDLUU", "RDLLUR", "RRDLLU", "RRULLD", "RULLDR", "RUULDD", "ULDDRU", "ULLDRR", "URDDLU", "URRDLL", "UULDDR", "UURDDL"}

This is a standard code golf challenge, where the shortest answer wins. Standard rules apply.

Jelly, 19 bytes
“ḅḍʂ»ðṗẆċⱮṚƑ¥ƇḢɗƑƇ⁸

A monadic Link accepting a non negative integer which yields a list of lists of characters.
Try it online!
How?
Much the same as Zgarb's Husk answer...
“ḅḍʂ»ðṗẆċⱮṚƑ¥ƇḢɗƑƇ⁸ - Link: integer, L
“ḅḍʂ»               - compressed string "URLD"
     ð              - start a new dyadic chain, f("URLD", L)
      ṗ             - ("URLD") Cartesian power (L) -> all length L strings using "URLD"
                 Ƈ  - keep those (s in those strings) for which:
                Ƒ   -   is invariant under?:
                  ⁸ -     use chain's left argument, "URLD", as the right argument of:
               ɗ    -       last three links as a dyad, f(s, "URLD"):
       Ẇ            -         all sublists (s)
             Ƈ      -         keep those (b in sublists(s)) for which:
            ¥       -           last two links as a dyad, f(b, "URLD"):
         Ɱ          -             map across (for c in "URLD") with f(b, c):
        ċ           -               count
           Ƒ        -             is invariant under?:
          Ṛ         -               reverse - i.e. count('U')=count('D')
                                               and count('R')=count('L')
              Ḣ     -         head (iff the only sublist with equal counts is the string
                                    itself then this will be that same string)

APL (Dyalog Extended), 39 bytes
{∧'LURD'⊇⍨m⌿⍨(⍲∘⍧=⊢/)⍤1+\0J1*m←⍉4⊤⍳4*⍵}

Try it online!
The output is a matrix of characters, one path on a line.
How it works
{∧'LURD'⊇⍨m⌿⍨(⍲∘⍧=⊢/)⍤1+\0J1*m←⍉4⊤⍳4*⍵}  ⍝ Input ⍵←n

m←⍉4⊤⍳4*⍵  ⍝ A matrix of all length-n combinations of 0..3
     ⍳4*⍵  ⍝ 0..4^n-1
   4⊤      ⍝ Convert each to base 4 (each goes to a column)
m←⍉        ⍝ Transpose and assign to m

∧'LURD'⊇⍨m⌿⍨(⍲∘⍧=⊢/)⍤1+\0J1*m
                        0J1*m  ⍝ Power of i (directions on complex plane)
                      +\       ⍝ Cumulative sum; the path of the robot
            (      )⍤1  ⍝ Test each row:
                 ⊢/     ⍝   the last number (real+imag is always even)
                =       ⍝   equals
             ⍲∘⍧        ⍝   NAND of the nub-sieve
                        ⍝   (0 if all numbers are unique, 1 otherwise)
                        ⍝ The condition is satisfied only if both are 0
         m⌿⍨  ⍝  Extract the rows that satisfy the above
 'LURD'⊇⍨     ⍝  Index each number into the string 'LURD'
∧             ⍝  Ascending sort

Python 2, 119 106 104 bytes
def f(n,s="",p=0,*v):
 if p==n<1:print s
 for d in"DLRU":p in v or 0<n<f(n-1,s+d,p+1j**(ord(d)%15),p,*v)

Try it online!

Same idea in Python 3:
Python 3, 102 100 bytes
-2 bytes thanks to @ovs!

def f(n,s="",p=0,*v):p==n<1==print(s);p in v or[f(n-1,s+d,p+1j**(ord(d)%15),p,*v)for d in"DLRU"if n]

Try it online!

A recursive function that prints the results to STDOUT. Keep track of s, p, v which are the current sequence, the current position (as a complex number), and the list of visited positions respectively.
The sequence is printed when n == 0 and the position is back to 0, aka p==n<1.
Otherwise, if there is still moves and no self-intersection (n > 0 and p not in v), the function tries to move the current position in 4 directions, and recurs. Given the character d that is one of the 4 character D, L, R, U, the direction is determined as
1j ** (ord(d) % 15)

since
d  ord(d)  ord(d)%15  1j**...
D   68        8         1
L   76        1         1j
R   82        7        -1j
U   85        10       -1

The Python 3 version can be 2 bytes shorter with p==n<1!=print(s).

@ovs thanks, I didn't realize that equality operatior works for None type too.

Husk, 21 bytes
fS=oḟȯE½M#₁Q`π₁
"RULD

Try it online!
Explanation
A string over RULD encodes a self-avoiding loop if and only if the only contiguous substring with an equal number of R and L, and of U and D, is the entire string.
I loop over all strings of the given length and check this condition by brute force.
fS=oḟȯE½M#₁Q`π₁  Implicit input n
            `π₁  Length-n words over string "RULD" (from second line).
f                Keep those that satisfy this:
           Q       List of substrings
   oḟ              Get the first one that satisfies this:
        M#₁          Counts of each letter in "RULD"
       ½             Split in half
     ȯE              The halves (counts of R,U vs counts of L,D) are equal
 S=                That equals the string, which is the last substring in the list

Wolfram Language (Mathematica), 99 96 bytes
-3 bytes thanks to my pronoun is monicareinstate!
Sort["ULDR"~StringPart~#&/@Select[Range@4~Tuples~#,Tr[a=I^#]==0&&DuplicateFreeQ@Accumulate@a&]]&

Try it online! Pure function. Takes a number as input and returns a list of character lists as output. (I believe such a format is acceptable.) The logic is pretty simple: It takes all n-tuples of 1, 2, 3, 4, interprets them as powers of i, checks that the sequences end at 0 and contain no duplicates, and converts them to the ULDR format.

96 bytes with StringPart: Sort["ULDR"~StringPart~#&/@Select[Range@4~Tuples~#,Tr[a=I^#]==0&&DuplicateFreeQ@Accumulate@a&]]&

@mypronounismonicareinstate Thanks! I'm still on 10.1, it's annoying that such a useful function wasn't introduced until 11.0...

Python 2, 155 139 bytes
r=input()
for y in range(4**r):
 n=0;s=[];k='';exec'c=y%4;y/=4;s+=n,;n+=1j**(6>>c);k="DLRU"[c]+k;'*r
 if n==0<2>max(map(s.count,s)):print k

Try it online!

perl -M5.010 -n, 189 bytes
$k=2*$_;@m=(D,L,R,U);y=D====y=U==&&y=R====y=L==&&!/.+(??{!($&=~y=D====$&=~y=U==&&$&=~y=R====$&=~y=L==&&y===c-length$&)})/&&say for map{sprintf("%0$k".b,$_)=~s/../'$m['."0b$&]"/geer}0..4**$_

Try it online!
This iterates over the numbers from 0 to 4^$_, where $_ is the input number. Each number is turned into a binary format (padded out with zeros so they're all the same length (twice the size of the  input)), and then 00 is replaced with D, 01 with L, 10 with R, and 11 with U. This enforces the correct order. Note that we include the number 4^$_ which will lead to a string that is "too long" (RDDD..D0), but will not pass the tests later on.
We then print the string if 1) they are a loop (contains the same number of Us and Ds, and the same number of Rs and Ls), and 2) no proper substring does contain a loop.
Expanding the program gives us:
#!/opt/perl/bin/perl

use 5.026;

use strict;
use warnings;
no  warnings 'syntax';

use experimental 'signatures';

my $k = 2 * $_;
my @m = ("D", "L", "R", "U");

y/D// == y/U//  &&   # Does $_ contain as many D's as U's ?
y/R// == y/L//  &&   # Does $_ contain as many R's as L's ?
!/.+                 # Grab a substring
  (??{               # Code block, result is seen as a pattern
       !(            # Negate what follows, if true, the result is ""
                     #     and "" will always match
                     #                      if false, the result is 1,
                     #     and since the string does not contain a 1,
                     #     the match will fail
         $& =~ y!D!! == $& =~ y!U!!  && # Does the substring contain as many
                                        # D's as U's?
         $& =~ y!R!! == $& =~ y!L!!  && # Does the substring contain as many
                                        # R's as L's?
         y!!!c - length ($&)            # Is this a proper substring?
                                        # y!!!c is a funny way getting the
                                        # length of $_, saving 1 byte over
                                        # using length, and if the lengths
                                        # are unequal, subtracting them is
                                        # a true value
       )})/x    &&   # if all conditions are met
say                  # print the results
for                  # do this for each
map {
    sprintf ("%0$k" . "b", $_)          # Get the binary representation
    =~ s/../'$m[' . "0b$&]"/geer        # And replace pairs of digits
                                        # with directions; we're using a
                                        # double eval -- first to turn the
                                        # replacement part into '$m[0bXX]',
                                        # with XX the two binary digits from
                                        # match, then we eval that result to
                                        # get the right direction.
} 0 .. 4 ** $_;      # Range of numbers

__END__

Swift 5/Xcode 10.3, 434 433 417 399 366 360 273 bytes
func g(_ a:[(Int,Int)],_ b:String)->[String]{let l=a.last!;if b.count==n{return l==(0,0) ?[b]:[]};return[(l.0,l.1-1,"D"),(l.0-1,l.1,"L"),(l.0+1,l.1,"R"),(l.0,l.1+1,"U")].flatMap{m in a[1...].contains{$0.0==m.0 && $0.1==m.1} ?[]:g(a+[(m.0,m.1)],b+m.2)}};return g([(0,0)],"")

Try it online!

Python 3, 232 bytes
from itertools import*
x,y,z={"D":1,"U":-1},{"L":-1,"R":1},()
for j in product(*("DLRU",)*int(input())):
 n,m,s=0,0,()
 for c in j:
  if (n,m)in s:n=1e999
  s+=(n,m),;n+=x.get(c,0);m+=y.get(c,0);
 z+=("".join(j),)*(n==m==0)
print(z)

Brute-force approach (checks every possible string of the given length, with no optimization for performance).
Can probably be golfed a lot more, but still includes several non-obvious tricks to it. The most notable is setting n to 1e999 (a short form for infinity) when a self-crossing path is detected, ensuring that it never goes back to zero and saving 3 bytes over the more obvious approach of break in the loop and moving the assignment to z into a else.
Try it online!

JavaScript (V8), 106 bytes
Prints the paths to STDOUT.
f=(n,s='',p=0,o=[])=>s[n-1]?p||print(s):(o[n*n+p]^=1)&&[n,-1,1,-n].map((d,i)=>f(n,s+'DLRU'[i],p+d,[...o]))

Try it online!
Commented
f = (                   // a recursive function taking:
  n,                    //   n = input
  s = '',               //   s = output string
  p = 0,                //   p = position
  o = []                //   o[] = array holding all visited positions
) =>                    //
  s[n - 1] ?            // if s has the requested length:
    p || print(s)       //   print it only if we're back to our starting point
  :                     // else:
    (o[n * n + p] ^= 1) //   toggle the item in o[] at n² + p
                        //   NB: we need n² to make sure it's positive
    &&                  //   abort if it's now set to 0 (meaning that this
                        //   position was already visited)
    [n, -1, 1, -n]      //   list of directions (down, left, right, up)
    .map((d, i) =>      //   for each direction d at position i:
      f(                //     do a recursive call:
        n,              //       pass n unchanged
        s + 'DLRU'[i],  //       append the direction character to s
        p + d,          //       add the direction to the position
        [...o]          //       pass a copy of o[]
      )                 //     end of recursive call
    )                   //   end of map()

Charcoal, 60 59 bytes
Ｎθ⊞υωＦυ«≔Ｅι§⟦¹θ±¹±θ⟧⌕LURDκζ¿¬№ＥζΣ…ζλΣζ¿‹ＬιθＦLURD⊞υ⁺ικ¿¬Σζ⟦ι

Try it online! Link is to verbose version of code. Explanation:
Ｎθ

Input n.
⊞υω

Start the list of sequences off with an empty sequence.
Ｆυ«

Perform a breadth-first search of sequences.
≔Ｅι§⟦¹θ±¹±θ⟧⌕LURDκζ

Convert the sequence into a list of directions 1, i, -1 and -i. As Charcoal doesn't have complex numbers, I'm simulating them using n instead of i. It's not possible for n of these numbers to overflow to zero (I need n 1s and an n+1th -n to do that) so I'm safe.
¿¬№ＥζΣ…ζλΣζ

Take the sums of the proper prefixes and check that the sum of the directions does not appear. Note that due to a Charcoal quirk the sum of [] is not zero, so we can allow a single zero to appear as a sum of the sequence.
¿‹Ｌιθ

Is this sequence of the desired length? If not...
ＦLURD

Loop over each direction.
⊞υ⁺ικ

Append the direction and push this candidate sequence to the list of sequences.
¿¬Σζ

Did this sequence of the desired length finish back at the origin?
⟦ι

If so then print it on its own line.

Complex numbers can be obtained using PythonEvaluate resulting in a 55-byte solution: Try it online! Subtract 1 further byte if using the newer version of Charcoal on ATO as you can simply use Cast in this case.


text:
Draw the "{} CODE GOLF & coding challenges" logo!
Wow, time really flies! It's already been one year since the debut of the Code Golf Stack Exchange site design. Let's celebrate this milestone with a code golf challenge... to imitate the site logo!
Golf a program that outputs a graphic of a medal enclosed in curly braces {}, along with two lines of text containing CODE GOLF and & coding challenges.
The medal graphic {} should consist of the following:

The medallion: A solid-filled circle with radius r, surrounded by a concentric ring of the same color with an outer radius between 1.5r and 1.6r and a thickness between 0.2r and 0.3r.
The ribbon: A solid-filled, horizontally symmetrical hexagon with height between 3r and 4r and side lengths ranging from 1.8r to 2.4r, placed directly above the medallion and sharing its vertical axis of symmetry.

A "y"-shaped cutout within the hexagon (masked out or solid-filled with the background color). This is defined by a horizontally centered, solid, downward-pointing acute isosceles triangle, with the right side extended by a line segment of thickness up to 0.3r that intersects with the bottom left vertex of the hexagon. (The left and right sides should be co-linear with the top left and top right vertices of the hexagon, respectively.)

A pair of curly braces { and } with a height between 6r and 7r, such that the imaginary horizontal axis that joins the "spikes" {——} falls below the apex of the cut-out isosceles triangle and above the medallion's outer ring.

The text output should consist of the string CODE GOLF above the string & coding challenges, with the horizontal spans of & and s falling within those of C and F respectively. You can achieve this any way you like, including, but not limited to:

Rendering text within the image, to the right of the {}.
Rendering text in a separate image, window, or GUI element.
Printing to standard output/standard error.

To justify the text, you may add spaces uniformly between the letters and words such that the letter spacing to word spacing ratio is no more than 2/3, e.g:
C  O  D  E   G  O  L  F
&   coding   challenges

Ensure all shapes and glyphs in your output are solid-filled and non-overlapping. Optionally, color your medal #F7CC46 gold and #0061BA blue (and #004E96 blue?) for some bonus internet points!
This is code-golf; the less bytes, the better. Be sure to include a screenshot in your answer!

For reference, the official SVG logo is as follows:

html { background: #2b2520 }
<svg xmlns="http://www.w3.org/2000/svg" height="126" viewBox="0 0 200 42" fill="none">
    <path d="M74.053 22.38c-1.561 0-2.976-.332-4.245-.994a7.756 7.756 0 0 1-2.977-2.785c-.714-1.195-1.072-2.54-1.072-4.037 0-1.497.358-2.836 1.072-4.016a7.546 7.546 0 0 1 2.977-2.785c1.269-.676 2.691-1.015 4.267-1.015 1.327 0 2.523.23 3.588.691a7.184 7.184 0 0 1 2.714 1.987L78.1 11.498c-1.036-1.18-2.32-1.77-3.851-1.77-.949 0-1.795.208-2.539.626a4.405 4.405 0 0 0-1.75 1.705c-.409.735-.613 1.57-.613 2.505 0 .935.204 1.77.613 2.504a4.556 4.556 0 0 0 1.75 1.727c.744.403 1.59.605 2.539.605 1.531 0 2.815-.598 3.851-1.792l2.276 2.072a7.085 7.085 0 0 1-2.714 2.008c-1.08.46-2.283.691-3.61.691zM89.869 22.38c-1.59 0-3.028-.339-4.311-1.015-1.27-.677-2.269-1.605-2.998-2.786-.715-1.194-1.073-2.533-1.073-4.015 0-1.483.358-2.814 1.073-3.994a7.663 7.663 0 0 1 2.998-2.807c1.283-.676 2.72-1.015 4.31-1.015 1.59 0 3.02.339 4.29 1.015a7.664 7.664 0 0 1 2.998 2.807c.729 1.18 1.094 2.511 1.094 3.994 0 1.482-.365 2.82-1.094 4.015-.73 1.18-1.73 2.109-2.998 2.785-1.27.677-2.7 1.015-4.29 1.015zm0-2.98c.904 0 1.721-.202 2.45-.605a4.444 4.444 0 0 0 1.707-1.727c.423-.734.635-1.569.635-2.504 0-.936-.212-1.77-.635-2.505a4.296 4.296 0 0 0-1.706-1.705c-.73-.418-1.547-.626-2.451-.626-.905 0-1.722.208-2.451.626a4.445 4.445 0 0 0-1.729 1.705c-.408.735-.613 1.57-.613 2.505 0 .935.205 1.77.613 2.504a4.6 4.6 0 0 0 1.729 1.727c.73.403 1.546.605 2.45.605zM100.914 7.007h6.959c1.663 0 3.129.317 4.398.95 1.284.62 2.276 1.497 2.976 2.634.715 1.137 1.072 2.462 1.072 3.973 0 1.511-.357 2.835-1.072 3.972-.7 1.137-1.692 2.022-2.976 2.656-1.269.619-2.735.928-4.398.928h-6.959V7.007zm6.784 12.242c1.531 0 2.75-.418 3.654-1.252.919-.85 1.379-1.994 1.379-3.433 0-1.44-.46-2.576-1.379-3.411-.904-.85-2.123-1.274-3.654-1.274h-3.239v9.37h3.239zM130.853 19.314v2.806h-11.86V7.007h11.576v2.807h-8.053v3.282h7.112v2.72h-7.112v3.498h8.337zM150.222 14.326h3.239v6.132c-.832.619-1.795 1.094-2.889 1.425a11.349 11.349 0 0 1-3.304.496c-1.59 0-3.02-.33-4.289-.993-1.269-.676-2.269-1.605-2.998-2.785-.715-1.195-1.072-2.54-1.072-4.037 0-1.497.357-2.836 1.072-4.016.729-1.194 1.736-2.123 3.02-2.785 1.283-.676 2.728-1.015 4.332-1.015 1.343 0 2.561.223 3.655.67a7.24 7.24 0 0 1 2.757 1.943l-2.276 2.072c-1.094-1.137-2.414-1.705-3.961-1.705-.977 0-1.845.201-2.604.604a4.37 4.37 0 0 0-1.772 1.706c-.423.734-.635 1.576-.635 2.526 0 .935.212 1.77.635 2.504a4.557 4.557 0 0 0 1.751 1.727c.758.403 1.619.605 2.582.605 1.021 0 1.94-.216 2.757-.648v-4.426zM164.172 22.38c-1.59 0-3.027-.339-4.311-1.015-1.269-.677-2.269-1.605-2.998-2.786-.715-1.194-1.072-2.533-1.072-4.015 0-1.483.357-2.814 1.072-3.994.729-1.195 1.729-2.13 2.998-2.807 1.284-.676 2.721-1.015 4.311-1.015 1.59 0 3.02.339 4.289 1.015a7.669 7.669 0 0 1 2.998 2.807c.729 1.18 1.094 2.511 1.094 3.994 0 1.482-.365 2.82-1.094 4.015-.73 1.18-1.729 2.109-2.998 2.785-1.269.677-2.699 1.015-4.289 1.015zm0-2.98c.904 0 1.721-.202 2.451-.605a4.45 4.45 0 0 0 1.707-1.727c.423-.734.634-1.569.634-2.504 0-.936-.211-1.77-.634-2.505a4.303 4.303 0 0 0-1.707-1.705c-.73-.418-1.547-.626-2.451-.626-.905 0-1.722.208-2.451.626a4.448 4.448 0 0 0-1.729 1.705c-.408.735-.612 1.57-.612 2.505 0 .935.204 1.77.612 2.504.423.734 1 1.31 1.729 1.727.729.403 1.546.605 2.451.605zM175.217 7.007h3.545V19.27h7.681v2.85h-11.226V7.007zM191.969 9.814v3.994h7.09v2.807h-7.09v5.505h-3.545V7.007H200v2.807h-8.031zM68.163 33.798c.865 0 1.564-.313 2.132-.788.557.382 1.102.649 1.635.788l.343-1.089c-.367-.104-.77-.312-1.208-.602.521-.787.9-1.678 1.161-2.628h-1.255c-.178.764-.45 1.424-.806 1.968a9.46 9.46 0 0 1-1.646-1.713c.781-.59 1.575-1.204 1.575-2.177 0-.96-.628-1.609-1.682-1.609-1.101 0-1.812.845-1.812 1.887 0 .51.19 1.1.51 1.714-.711.498-1.35 1.111-1.35 2.118 0 1.193.911 2.13 2.403 2.13zm-.426-5.974c0-.58.273-.973.687-.973.45 0 .604.313.604.718 0 .567-.438.972-.995 1.355-.19-.383-.296-.753-.296-1.1zm.592 4.943c-.722 0-1.267-.474-1.267-1.18 0-.452.249-.823.592-1.158a10.731 10.731 0 0 0 1.753 1.898c-.331.278-.699.44-1.078.44zM83.658 33.798c.83 0 1.682-.29 2.357-.857l-.569-.857c-.45.336-.994.625-1.658.625-1.148 0-1.93-.752-1.93-1.887 0-1.146.805-1.898 1.966-1.898.521 0 .983.185 1.433.544l.651-.834c-.485-.451-1.22-.799-2.155-.799-1.777 0-3.305 1.088-3.305 2.987 0 1.887 1.386 2.976 3.21 2.976zM90.239 33.798c1.528 0 2.925-1.089 2.925-2.976 0-1.898-1.397-2.987-2.925-2.987-1.528 0-2.926 1.088-2.926 2.987 0 1.887 1.398 2.976 2.926 2.976zm0-1.089c-.948 0-1.516-.752-1.516-1.887 0-1.146.568-1.898 1.516-1.898.947 0 1.516.752 1.516 1.898 0 1.135-.569 1.887-1.516 1.887zM96.902 33.798c.652 0 1.303-.36 1.753-.8h.036l.106.66h1.126v-8.173h-1.374v2.06l.07.962h-.035c-.45-.429-.936-.672-1.599-.672-1.326 0-2.57 1.135-2.57 2.987 0 1.876.995 2.976 2.487 2.976zm.332-1.1c-.888 0-1.41-.66-1.41-1.887 0-1.193.676-1.876 1.481-1.876.426 0 .829.139 1.244.521v2.559c-.403.463-.83.683-1.315.683zM104.407 33.659h1.362v-5.685h-3.885v1.054h2.523v4.63zm.58-6.727c.557 0 .971-.347.971-.891 0-.533-.414-.903-.971-.903-.557 0-.971.37-.971.903 0 .544.414.891.971.891zM108.962 33.659h1.374V29.78c.533-.532.924-.799 1.492-.799.794 0 1.09.417 1.09 1.332v3.346h1.374v-3.52c0-1.47-.616-2.304-1.954-2.304-.889 0-1.552.452-2.097.996h-.047l-.107-.857h-1.125v5.685zM118.48 36.171c2.049 0 3.352-.891 3.352-2.014 0-.996-.782-1.39-2.286-1.39h-1.184c-.723 0-1.102-.162-1.102-.532 0-.232.119-.394.355-.533.308.104.628.162.889.162 1.303 0 2.333-.671 2.333-1.933 0-.37-.178-.718-.379-.938h1.338v-1.019h-2.38a2.792 2.792 0 0 0-.912-.139c-1.279 0-2.393.741-2.393 2.05 0 .67.332 1.18.746 1.47v.046c-.426.278-.698.695-.698 1.065 0 .475.284.764.592.95v.046c-.604.324-.924.74-.924 1.192 0 1.02 1.054 1.517 2.653 1.517zm.024-5.152c-.604 0-1.102-.417-1.102-1.135 0-.694.498-1.123 1.102-1.123.604 0 1.101.429 1.101 1.123 0 .718-.497 1.135-1.101 1.135zm.142 4.272c-1.078 0-1.682-.3-1.682-.81 0-.267.154-.51.569-.741.236.058.509.08.888.08h.924c.781 0 1.172.117 1.172.556 0 .487-.734.915-1.871.915zM133.371 33.798a3.69 3.69 0 0 0 2.357-.857l-.569-.857c-.45.336-.995.625-1.658.625-1.149 0-1.931-.752-1.931-1.887 0-1.146.806-1.898 1.966-1.898.522 0 .983.185 1.434.544l.651-.834c-.486-.451-1.22-.799-2.156-.799-1.776 0-3.304 1.088-3.304 2.987 0 1.887 1.386 2.976 3.21 2.976zM137.369 33.659h1.374V29.78c.533-.532.924-.799 1.492-.799.794 0 1.09.417 1.09 1.332v3.346h1.374v-3.52c0-1.47-.616-2.304-1.954-2.304-.889 0-1.54.452-2.049.973h-.036l.083-1.216v-2.107h-1.374v8.174zM146.283 33.798c.782 0 1.564-.382 2.179-.846h.036l.107.707h1.113v-3.37c0-1.586-.888-2.454-2.499-2.454-.995 0-1.954.382-2.653.787l.497.892c.604-.324 1.256-.602 1.907-.602.948 0 1.338.475 1.386 1.111-2.866.197-4.015.834-4.015 2.107 0 .996.805 1.668 1.942 1.668zm.415-1.042c-.581 0-1.043-.22-1.043-.73 0-.613.616-1.03 2.701-1.17v1.205c-.533.417-1.078.695-1.658.695zM155.351 33.798c.675 0 1.078-.116 1.646-.325l-.319-.984c-.368.15-.687.22-.995.22-.581 0-1.043-.29-1.043-1.053v-6.171h-3.197v1.053h1.835v5.048c0 1.401.723 2.212 2.073 2.212zM162.453 33.798c.675 0 1.078-.116 1.646-.325l-.32-.984c-.367.15-.687.22-.995.22-.58 0-1.042-.29-1.042-1.053v-6.171h-3.198v1.053h1.836v5.048c0 1.401.723 2.212 2.073 2.212zM168.714 33.798c.852 0 1.658-.278 2.274-.672l-.462-.833c-.521.289-1.019.474-1.635.474-1.077 0-1.847-.51-2.001-1.563h4.275c.024-.15.06-.405.06-.671 0-1.575-.96-2.698-2.689-2.698-1.563 0-3.008 1.123-3.008 2.976 0 1.887 1.409 2.987 3.186 2.987zm-.142-4.932c.829 0 1.35.463 1.445 1.389h-3.092c.178-.915.841-1.39 1.647-1.39zM172.878 33.659h1.374V29.78c.533-.532.924-.799 1.492-.799.794 0 1.09.417 1.09 1.332v3.346h1.374v-3.52c0-1.47-.616-2.304-1.954-2.304-.889 0-1.552.452-2.097.996h-.047l-.107-.857h-1.125v5.685zM182.396 36.171c2.049 0 3.352-.891 3.352-2.014 0-.996-.782-1.39-2.286-1.39h-1.184c-.723 0-1.102-.162-1.102-.532 0-.232.119-.394.356-.533.307.104.627.162.888.162 1.303 0 2.333-.671 2.333-1.933 0-.37-.178-.718-.379-.938h1.338v-1.019h-2.38a2.792 2.792 0 0 0-.912-.139c-1.279 0-2.393.741-2.393 2.05 0 .67.332 1.18.746 1.47v.046c-.426.278-.698.695-.698 1.065 0 .475.284.764.592.95v.046c-.604.324-.924.74-.924 1.192 0 1.02 1.054 1.517 2.653 1.517zm.024-5.152c-.604 0-1.102-.417-1.102-1.135 0-.694.498-1.123 1.102-1.123.604 0 1.101.429 1.101 1.123 0 .718-.497 1.135-1.101 1.135zm.142 4.272c-1.078 0-1.682-.3-1.682-.81 0-.267.154-.51.569-.741.236.058.509.08.888.08h.924c.781 0 1.172.117 1.172.556 0 .487-.734.915-1.871.915zM190.019 33.798c.853 0 1.658-.278 2.274-.672l-.462-.833c-.521.289-1.018.474-1.634.474-1.078 0-1.848-.51-2.002-1.563h4.276a4.52 4.52 0 0 0 .059-.671c0-1.575-.959-2.698-2.689-2.698-1.563 0-3.008 1.123-3.008 2.976 0 1.887 1.409 2.987 3.186 2.987zm-.142-4.932c.829 0 1.35.463 1.445 1.389h-3.091c.177-.915.841-1.39 1.646-1.39zM196.801 33.798c1.765 0 2.724-.788 2.724-1.76 0-.903-.485-1.39-2.345-1.795-1.078-.231-1.516-.37-1.516-.775 0-.348.308-.626 1.078-.626.687 0 1.35.209 1.919.568l.627-.822c-.592-.382-1.468-.753-2.428-.753-1.634 0-2.558.706-2.558 1.702 0 .857.699 1.401 2.25 1.714 1.351.277 1.611.486 1.611.856 0 .382-.379.683-1.184.683a4.373 4.373 0 0 1-2.44-.717l-.592.845c.722.474 1.764.88 2.854.88zM45.057 36.394c.872 0 1.575-.043 2.109-.128.562-.084.998-.24 1.307-.466.309-.226.52-.538.632-.934.14-.367.211-.848.211-1.442 0-1.16-.028-2.277-.084-3.352a68.576 68.576 0 0 1-.085-3.564c0-1.612.324-2.771.97-3.479.635-.721 1.69-1.212 3.163-1.47a.101.101 0 0 0 .084-.1.101.101 0 0 0-.084-.099c-1.474-.258-2.528-.734-3.163-1.428-.646-.735-.97-1.909-.97-3.521 0-1.273.029-2.46.085-3.564.056-1.103.084-2.22.084-3.352 0-.594-.07-1.074-.21-1.442a1.69 1.69 0 0 0-.633-.933c-.31-.227-.745-.382-1.307-.467-.534-.085-1.237-.127-2.109-.127h-.074a1.655 1.655 0 0 1 0-3.31h1.592c2.699 0 4.68.439 5.946 1.316 1.265.848 1.897 2.418 1.897 4.709 0 .735-.028 1.414-.084 2.036a17.36 17.36 0 0 1-.169 1.74 310.46 310.46 0 0 0-.169 1.655 36.891 36.891 0 0 0-.042 1.824c0 .367.085.735.253 1.103.169.368.478.707.928 1.018.45.283 1.04.523 1.77.721.316.07.665.13 1.048.175 1.008.121 1.82.932 1.82 1.947 0 1.014-.813 1.822-1.818 1.96-.384.053-.733.121-1.05.203-.73.17-1.32.41-1.77.722-.45.283-.759.608-.928.976a2.627 2.627 0 0 0-.253 1.102c0 .68.014 1.302.042 1.867.057.538.113 1.09.17 1.655.084.537.14 1.103.168 1.697.056.594.084 1.273.084 2.036 0 2.291-.632 3.861-1.897 4.71-1.265.877-3.247 1.315-5.946 1.315h-1.592a1.655 1.655 0 0 1 0-3.31h.074zM14.716 36.394c-.871 0-1.574-.043-2.108-.128-.563-.084-.998-.24-1.308-.466a1.69 1.69 0 0 1-.632-.934c-.14-.367-.21-.848-.21-1.442 0-1.16.027-2.277.084-3.352.056-1.075.084-2.262.084-3.564 0-1.612-.323-2.771-.97-3.479-.635-.721-1.689-1.212-3.163-1.47a.101.101 0 0 1-.084-.1c0-.048.036-.09.084-.099 1.474-.258 2.528-.734 3.163-1.428.647-.735.97-1.909.97-3.521 0-1.273-.028-2.46-.084-3.564a65.75 65.75 0 0 1-.085-3.352c0-.594.07-1.074.211-1.442a1.69 1.69 0 0 1 .633-.933c.309-.227.745-.382 1.307-.467.534-.085 1.236-.127 2.108-.127h.074a1.655 1.655 0 1 0 0-3.31h-1.592c-2.699 0-4.68.439-5.945 1.316C5.988 5.38 5.355 6.95 5.355 9.24c0 .735.028 1.414.084 2.036.029.594.085 1.174.17 1.74.055.537.112 1.089.168 1.655.028.565.042 1.173.042 1.824 0 .367-.084.735-.253 1.103-.169.368-.478.707-.928 1.018-.45.283-1.04.523-1.77.721-.316.07-.665.13-1.048.175C.812 19.634 0 20.445 0 21.46c0 1.014.813 1.822 1.818 1.96.384.053.734.121 1.05.203.73.17 1.32.41 1.77.722.45.283.76.608.928.976.169.367.253.735.253 1.102 0 .68-.014 1.302-.042 1.867-.056.538-.113 1.09-.169 1.655-.084.537-.14 1.103-.169 1.697a21.84 21.84 0 0 0-.084 2.036c0 2.291.633 3.861 1.898 4.71 1.265.877 3.246 1.315 5.945 1.315h1.592a1.655 1.655 0 1 0 0-3.31h-.074z" fill="#fff"/>
    <path fill="#004E96" d="M23.74.772h11.663v4.597H23.74z"/>
    <path d="M35.423.772l4.991 7.225a3 3 0 0 1 .078 3.293l-6.313 10.123h-6.437L35.422.772z" fill="#0061BA"/>
    <path fill-rule="evenodd" clip-rule="evenodd" d="M29.581 41.228a9.194 9.194 0 1 0 0-18.39 9.194 9.194 0 1 0 0 18.39zm0-16.866a7.671 7.671 0 1 0 0 15.343 7.671 7.671 0 0 0 0-15.343zm-5.901 7.671a5.902 5.902 0 1 1 11.803 0 5.902 5.902 0 0 1-11.803 0z" fill="#F7CC46"/>
    <path fill-rule="evenodd" clip-rule="evenodd" d="M18.748 7.997L23.74.772l4.93 13.249-2.767 7.392h-.919L18.671 11.29a3 3 0 0 1 .077-3.293zm8.994 13.416h3.678l-1.834-4.928-1.844 4.928z" fill="#0061BA"/>
</svg>

Hmm ... have we not had this before? Or was the one I'm thinking of [tag:ascii-art]? Or maybe it was for our old icon?

@Shaggy I posted an ascii-art of the new logo in the Secret Santa's Sandbox a while back. But I don't think it was either used.

An image with the relevant measurements marked could perhaps be useful as an easier reference than the description.

Note: the official SVG logo you provided does not conform to your own specifications.

SVG, 259 bytes

<svg viewBox=-30,-29,200,40><text x=-26 font-size=32>{ }</text><text x=25 y=-9>CODE GOLF</text><text x=29 font-size=9>& coding challenges</text><path fill=blue d=M-4.5-24h9l4,8-4,8h-8l6-12h-5l2,4-4,8-4-8 /><g fill=gold><circle r=6.8 /><circle r=5 stroke=#fff>

Also including a screenshot, since this is um.. not exactly best practises and will probably not look right in all browsers.

On my computer } shows behind ``

You can reduce it a little bit more by removing the rest of the commas before negative values, as well as the space in d= M...

You just removed the medallion. Not that it matters anyway, since this is already invalid.

@Makonede What part do you consider invalid?

Your answer does not meet the specifications, but more importantly, the } shows behind the ``.

@Makonede Can you point out what part of the specification this violates? Also, per the usual site guidelines, a solution needs only work in one implementation of a language. } rendering behind the medallion in some browsers is not a problem as long as it works in at least one.

@SE-stopfiringthegoodguys You're clearly using something to modify the font on your end, I can already tell that in the screenshot you don't have the default font for rendering SVG enabled. It's not about the implementation. And, for one, the medallion doesn't fit the rule of the outer radius being 1.5-1.6 times the inner radius. Also, CODE GOLF is too wide, it extends beyond the & and s.

@Makonede This is perfectly fine. The & and the s are meant to fit within the span of the F and C.

@Ausername Good point. Editing that out - EDIT: it's been 5 minutes :/

@Makonede The rendering with the brackets is probably because different system fonts have different default spacings.

@Ausername Ok. Still doesn't address the specs though.

Looks like the stroke should have been on the last circle instead. Within the ranges now.

@SE-stopfiringthegoodguys You still need to fix the ribbon.

@Makonede The specification says "co-linear with the top left and top right vertices of the hexagon", not that those lines must also be the diagonals of the hexagon.

OK, cool

@Makonede I appreciate your attention to detail! Perhaps you'd like to edit out/rewrite your suggestions on the other submissions regarding the horizontal span requirement?

05AB1E, 123 115 bytes
„P122žw•·54†u%í[Ç¤õìEEÖÇćÃKõ&Ê»¦1ćÊ₂à<äć°S£ŸǝzMçqõR^ùµTÄYšαÄâ[¬Å%J#›-J(%í/ûÜN₅≠ÝmÁ∞j!i_´ÿÓÙ7žŠλ•bÀðT×…ƒËÿŠˆu…&Âïªï»

Try it online! Beats all other answers. Technically, there is only one other valid answer. All other answers don't meet the specifications. Outputs as a plain PBM, and outputs the text after it.
Output (enlarged)

Actual output size is 22x32.

„P122žw•...•bÀðT×…...u…...»  # trimmed program
„P1                          # push literal
   22                        # push literal
     žw                      # push 32
       •...•                 # push 166945169634011025567565467884298025990186958890541902453598900323554121322972765574841330722535555954069208033251875962777321153953373288109249110692417567618626198556352935215968754836351913816090583315808287...
            b                # in binary...
             À               # shifted left 1 character
                 …...        # push "codeÿ golf"...
                             # (implicit) with ÿ replaced by...
               T             # 10...
              ð              # space...
                ×            # s...
                     u       # in uppercase
                      …...   # push "& coding challenges"
                          »  # join stack by newlines
                             # implicit output

ðT× can also be 9çº to slightly increase the distance between CODE and GOLF: Try it online!

This is invalid, you need the text.

@Ausername This outputs the text after the PBM. The challenge specifically states outputting the text to STDOUT is allowed.

Do "the horizontal spans of & and s falling within those of C and F respectively"? If not, this is invalid

@cairdcoinheringaahing Yes, you can see that the C lines up wih the & and the F lines up with the s.

PostScript, 432 bytes
Code (compressed version):
<</L{lineto}/F{closepath fill}/S{setrgbcolor}/t{translate}/N{newpath}/H/Helvetica/M{moveto}/T{M selectfont show}/C{N 0 360 arc F}>> begin 15 15 scale ({  }) H 7.2 0 2 T (CODE GOLF) H 3.6 9 4 T (& coding challenges) H 2.35 9 1 T 4.2 2.4 t .94 .8 .27 S 0 0 1.5 C 1 1 1 S 0 0 1.25 C .94 .8 .27 S 0 0 1 C 0 3 t 0 .31 .59 S N 1.55 0 M 6{60 rotate 1.55 0 L}repeat F 1 1 1 S N -.7 -1.35 M -.05 0 L -.45 .9 L .45 .9 L -.5 -1.35 L F showpage

Code (uncompressed version):
% some short-named procedures for later use
<<
  /L {lineto}
  /F {closepath fill}
  /S {setrgbcolor}
  /t {translate}
  /N {newpath}
  /H /Helvetica
  /M {moveto}
  /T {  % text fontname fontsize x y --> ---
    M selectfont show
  }
  /C {  % x y radius --> ---
    N 0 360 arc F
  }
>> begin

15 15 scale

% Draw the texts
({  }) H 7.2 0 2 T
(CODE GOLF) H 3.6 9 4 T
(& coding challenges) H 2.35 9 1 T

% Draw the medaillon
4.2 2.4 t
.94 .8 .27 S % gold
0 0 1.5 C
1 1 1 S   % white
0 0 1.25 C
.94 .8 .27 S % gold
0 0 1 C

% Draw the ribbon
0 3 t
0 .31 .59 S   % blue
N 1.55 0 M
6 {60 rotate 1.55 0 L} repeat
F
1 1 1 S  % white
N
-.7 -1.35 M
-.05 0 L
-.45 .9 L
.45 .9 L
-.5 -1.35 L
F

showpage

Result:

The ribbon and its sides are too short, the line connecting the spikes of the braces is lower than the medallion's outer ring, & coding challenges does not fit within the horizontal span of CODE GOLF, and the triangle and line are not aligned with the ribbon's corners.

Never mind, the triangle and line are good, but the line has an inconsistent thickness.

Octave / Matlab, 469 477 469 bytes

+8 To fix the size of "CODE GOLF"
-8 by talking tiny bit more liberty with the colours and removing  on after hold (given the default state of the hold is off, calling hold by itself just sets it to on)

y=[1,.8,.3],b=[0,.4,.8],w=[1,1,1],hold
e='Edgecolor',n='none',r=@real,i=@imag,p=@patch,x=@text,f='FontSize'
h=1.8*exp(j*pi/3*(0:5))
p(r(h),i(h),b,e,n)
t=exp(pi*[3,-1,-5]/6j)+j
t=[t,.2*t(3),t(3)'-.3,t(3)']-.6j
p(r(t),i(t),w,e,n)
c=exp(pi*(0:98)/49j)
c=@(a,l)p(r(a*c-3.3j),i(a*c-3.3j),l,e,n)
c(1.5,y),c(1.3,w),c(1,y)
x(-4,-1,'{',f,99),x(2,-1,'}',f,99)
x(5,0,'CODE GOLF',f,49)
x(5,-3,'& coding challenges',f,31)
axis equal off,ylim([-5 2]),xlim([-4 25])
set(gcf,'Color',w)

Try it online!, although you don't get the figure in TIO, so here is screenshot of the one I get.

Matlab version 9.3.0.948333 (R2017b) Update 9, on macOS Catalina, 10.15.4
Ungolfed
yellow = [246,204,70]/255;
blue = [0,97,186]/255;
white = [1 1 1];

hold on; % Allow multiple plots on the same axis (implicitly creates a figure)

% Make a blue hexagon
hex = exp(1i*2*pi/6*(0:5)); % Points on a hexagon
patch(real(1.8*hex),imag(1.8*hex),blue,'EdgeColor','none');

tri = exp(1i*(2*pi/3*(0:2)-3*pi/6))+1i;
tri = [tri (0.8*tri(1)+0.2*tri(3)) tri(3)'-0.3 tri(3)'];
patch(real(tri-.6i),imag(tri-.6i),white,'EdgeColor','none');

circ = exp(1i*linspace(0,2*pi,1e3)); % 100 points on a unit circle
co = -3.3i; % Offset
c = @(r,l)patch(real(r*circ+co),imag(r*circ+co),l,'EdgeColor','none');
c(1.5,yellow)
c(1.3,white)
c(1.0,yellow)

text(-4,-1,'{','FontSize',99);
text(2,-1,'}','FontSize',99);
text(5,-1.5,{'CODE GOLF','& coding challenges'},'FontSize',33)

axis equal off;
ylim([-5 2]); xlim([-4 25]);
set(gcf,'Color',white);
% grid on; box on;

Nice job! Just make sure "CODE GOLF" is large enough so that the "s" falls within the horizontal span of the "F".

@darrylyeo, Thanks for pointing this out. Fixed now. I had to add 8 bytes to to that, but I found an unrelated 8-byte saving on the way and so I broke even. :)

The triangle in the ribbon is not aligned with the corners of the ribbon.

Also, & coding challenges does not fit within the horizontal span of CODE GOLF.

LaTeX + TikZ, 449 bytes
\documentclass[tikz]{standalone}\usetikzlibrary{shapes}\begin{document}\tikz{\path[fill]circle(1.6)(0,3)node[scale=32]{\{~\}}(0,5)node[fill,regular polygon,regular polygon sides=6,inner sep=70]{}(0,5)node[fill=white,rotate=180,regular polygon,regular polygon sides=3,inner sep=20]{};\path[fill=white,rotate=60](0.6,1.5)rectangle(5,1.8)(0,0)circle(1.4);\fill circle(1)(17,3)node[scale=9,align=left]{CODE GOLF\\\tiny\&~coding challenges};}\enddocument

Readable version:
\documentclass[tikz]{standalone}
\usetikzlibrary{shapes}

\begin{document}
\tikz{
\path[fill]
    circle(1.6)
    (0,3)node[scale=32]{\{~\}}
    (0,5)node[fill,regular polygon,regular polygon sides=6,inner sep=70]{}
    (0,5)node[fill=white,rotate=180,regular polygon,regular polygon sides=3,inner sep=20]{};

\path[fill=white,rotate=60]
    (0.6,1.5)rectangle(5,1.8)
    (0,0)circle(1.4);

\fill
    circle(1)
    (17,3)node[scale=9,align=left]{CODE GOLF\\\tiny\&~coding challenges};
}
\enddocument

Outputs a PDF:

The height of that ribbon is nowhere near close to between $3r$ and $4r$.

Other problems: The outer ring is too thin and is not a perfect circle, the triangle and line aren't aligned with the corners of the ribbon, the ribbon's sides are too long, the braces are way too big, and & coding challenges does not fit within the horizontal span of CODE GOLF.

Wolfram Language (Mathematica), 332 bytes
g=Graphics;r=GraphicsRow;c=RGBColor;r@{r@{Style["{",30],GraphicsColumn[{g@{c@"#0061BA",Polygon[{{15,6},{6,23},{15,40},{36,40},{43,23},{37,6},{17,6},{32,30},{19,30},{24,20}}]},g@{{c@"#F7CC46",Disk[]},{White,Thickness[.05],Circle[{0,0},.8]}}},ImageSize->Scaled[.04]],Style["}",30]},Column@{Style["CODEGOLF",15.5],"&codingChallenges"}}

Try it online!

The outer radius is too small, the outer ring of the medallion is too thin, the line connecting the spikes of the braces is lower than the medallion's outer ring, the ribbon is too short and isn't horizontally symmetrical, the line extending out of the ribbon's triangle is too thin, the braces are too short, and & coding challenges does not fit within the horizontal span of CODE GOLF.

HTML + CSS, 958 656 588 bytes

<div style="display: flex; align-items:center; font-size:40px;">{

<div style="color: blue; line-height:0; transform: translate(-7px,07px); width: 32px">
  <div style="transform: scaleX(0.65); letter-spacing: -5px;">♦♦</div>
  <div style="width:16px; height:7px; background:blue; margin:-15px 0 0 15px "></div>
  <div style="transform: scale(0.47, 0.51); margin:14px 0 0 9px">▲</div>
  <div style="color: gold; font-size: 20px; margin:21px 0 0 13px">◉</div>
</div>

}<div><div style="font-size:21px">CODE GOLF</div><div style="font-size:14px">& coding challenges</div></div></div>

This solution works on Chrome and Safari

& coding challenges does not fit within the horizontal span of CODE GOLF, the outer radius in the medallion is too small, the outer ring is too thick, and the braces are too tall.

By the way, I'm not sure what version of Chrome/what OS you're using, but on Chrome on Windows, the ribbon is completely broken.


text:
Determine if a substructure is present in a chemical structure using SMILES string (substructure fingerprint)
A SMILES (Simplified molecular-input line-entry system) string is a string that represents a chemical structure using ASCII characters. For example, water (\$H_2O\$) can be written in SMILES as H-O-H.
However, for simplicity, the single bonds (-) and hydrogen atoms (H) are frequently omitted. Thus, a molecules with only single bonds like n-pentane (\$CH_3CH_2CH_2CH_2CH_3\$) can be represented as simply CCCCC, and ethanol (\$CH_3CH_2OH\$) as CCO or OCC (which atom you start from does not matter).
n-pentane:
ethanol:
In SMILES, double bonds are represented with = and triple bonds with #. So ethene:

can be represented as C=C, and hydrogen cyanide:

can be represented as C#N or N#C.
SMILES uses parentheses when representing branching:

Bromochlorodifluoromethane can be represented as FC(Br)(Cl)F, BrC(F)(F)Cl, C(F)(Cl)(F)Br, etc.
For rings, atoms that close rings are numbered:

First strip the H and start from any C. Going round the ring, we get CCCCCC. Since the first and last C are bonded, we write C1CCCCC1.
Use this tool: https://pubchem.ncbi.nlm.nih.gov/edit3/index.html to try drawing your own structures and convert them to SMILES, or vice versa.
Task
Your program shall receive two SMILES string. The first one is a molecule, the second is a substructure (portion of a molecule). The program should return true if the substructure is found in the molecule and false if not. For simplicity, only above explanation of SMILES will be used (no need to consider stereochemistry like cis-trans, or aromaticity) and the only atoms will be:

O
C
N
F

Also, the substructure do not contain H.
Examples
CCCC C
true

CCCC CC
true

CCCC F
false

C1CCCCC1 CC
true

C1CCCCC1 C=C
false

COC(C1)CCCC1C#N C(C)(C)C // substructure is a C connected to 3 other Cs
true

COC(C1)CCCCC1#N COC1CC(CCC1)C#N // SMILES strings representing the same molecule
true

OC(CC1)CCC1CC(N)C(O)=O CCCCO
true

OC(CC1)CCC1CC(N)C(O)=O NCCO
true

OC(CC1)CCC1CC(N)C(O)=O COC
false

Shortest code wins. Refrain from using external libraries.

Could you add a few more complexer test cases like the last one? The first five test cases can be solved using a single contains builtin.

As for that last test case, the COC(C1)CCCC1C#N can't be pasted to the tool you've linked (it automatically changes to COC1CC(CCC1)C#N..) Also, would COC(C1)CCCCC1#N with CCCCCC result in truthy, since it does contain a substructure of six subsequence C-atoms (the entire circle (C1)CCCCC1, and the additional branch to a C in COC)?

@KevinCruijssen i will add more examples. The tool converts the SMILES string to a canonical SMILES string (it uses a standard algorithm that ensures a unique output).
COC(C1)CCCCC1#N with CCCCCC will be truthy.
COC(C1)CCCCC1#N with COC1CC(CCC1)C#N will be truthy.

Mathematica, 31 bytes
MoleculeContainsQ@@Molecule/@#&

Takes input as a list of 2 strings (the source and the pattern molecules).
As you could guess, this checks if the first molecule (parsed via Molecule) contains the second one by using the MoleculeContainsQ function.
This doesn't seem to work in the online interpreter on TIO; I'm not sure what I am doing wrong. It works on my local machine, though. Of course, this is not using an external library: it's completely built-in functionality!

i'm looking for answers that do some parsing, but as your answer uses built-in functionality, i guess you've found a loophole! +1


text:
All you have to do is print the number 1! ...Twice
Your task
In your language of choice: create a program that outputs 1
This 1 may either be a string or value equivalent to the number one.
The shifting catch
If you take the unicode codepoint (or whatever codepoint encoding your languages uses if not UTF) for each character in your program, and shift each of those values by the same non-zero amount, then the result will be another program (potentially executable in different language) that also outputs 1.
Find the unicode codepoint of a character: here.
E.g;
If your program looked like: X?$A, and somehow output 1, and it also miraculously outputs 1 after shifting all of it's Unicode indices up by, say, 10; then that process of shifting looks like this:
original program: X?$A

letter    codepoint  shift   new-codepoint   new-letter

X            88       +10        98          b
 ?           63                  73          I
  $          36                  46          .
   A         65                  75          K

new program: BI.K

Note: The Unicode codepoint will often be represented  in the form similar to U+0058. 58 is the hexadecimal codepoint . In decimal, that's 88. The link above will list 88 under the UTF (decimal) encoding section. That is the number you want to increment or decrement!
Examples of valid outputs
1
"1"
'1'
[1]
(1)
1.0
00000001
one

Note: If your language only supports the output of true as an equivalent to 1, that is acceptable. Exit-codes are also valid outputs.
Scoring

This is code-golf, so lowest bytes wins!
Brownie points for creativity & if the two programs are in separate languages.

What if a language uses a different encoding instead of UTF-8 (i.e. Jelly, 05AB1E, Charcoal, etc.)? Do we still use the unicode codepoints, or the codepoints of the used language?

@KevinCruijssen For the sake of making this challenge not impossible, you can use either.

If two distinct 1-char programs in a language output 1, wouldn't it win the challenge? (or how about a 0-char program?)

@Bubbler That's valid! As you know, creativity seems to dominate votes more than byte-count anyways.

I guess output via exit code code is not allowed? Otherwise, Java, 0 bytes: https://tio.run/##y0osS9TNSsn@DwQA

@ovs I think that's right on the border between valid and invalid. You're welcome to post it anyway.

@ovs Outputting through exit code is a default valid option by the meta, so it should be fine.

Can I have a shift of 0?

What if 2 languages output 1 with the empty program? Does print(1) win the brownie points?

Does this count as "restricted-source"?

@Lyxal A shift of 0 would not satisfy “… then the result will be another program …”, nor would a 0 byte answer.

@Lyxal Cheeky, but no. :)

@Graviton Could you please add that to the question body, since rules of a challenge shouldn't be specified only in the comments.

@pppery The question has now been updated to fit all the previous clarifications in the comments. No answers have been made invalid.

Is it the shift modulo? So does the shift by 2147483648 counts?

@Hauleth I would expect that to mean the shifrted program would consist entirely of Unicode noncharacters.

@pppery this is amount of possible Unicode codepoints, so it should be the same as 0 shift.

Java, 62 bytes
interface M{static void main(String[]a){System.out.print(1);}}

Try it online.
05AB1E, 62 bytes
\agXeYTVXι@nfgTg\Vιib\Wι`T\a₂Fge\aZNPT₃nFlfgX`!bhg!ce\ag₂$₃.pp

Uses the 05AB1E encoding, with the codepoints all decreased by 13:

interface M{static void main(String[]a){System.out.print(1);}} has the codepoints [105,110,116,101,114,102,97,99,101,32,77,123,115,116,97,116,105,99,32,118,111,105,100,32,109,97,105,110,40,83,116,114,105,110,103,91,93,97,41,123,83,121,115,116,101,109,46,111,117,116,46,112,114,105,110,116,40,49,41,59,125,125]
\agXeYTVXι@nfgTg\Vιib\Wι`T\a₂Fge\aZNPT₃nFlfgX`!bhg!ce\ag₂$₃.pp has the codepoints [92,97,103,88,101,89,84,86,88,19,64,110,102,103,84,103,92,86,19,105,98,92,87,19,96,84,92,97,27,70,103,101,92,97,90,78,80,84,28,110,70,108,102,103,88,96,33,98,104,103,33,99,101,92,97,103,27,36,28,46,112,112].

Try it online.
Explanation:
Java:
interface M{                   // Full program:
  static void main(String[]a){ //  Mandatory main-method:
    System.out.print(          //   Print without trailing newline:
      1);}}                    //    Print 1

05AB1E:
\                  # Discard the top of the stack (no-op, since it's already empty)
                   #  STACK: []
 a                 # Check if it only consists of letters (resulting in falsey/0
                   # for an empty string "", which is used implicitly without input)
                   #  STACK: [0]
  g                # Push and push its length, which is 1
                   #  STACK: [1]
   X               # Push variable `X`, which is 1 by default
                   #  STACK: [1,1]
    e              # Push the number of permutations n!/(n-r)! with both 1s, which is 1
                   #  STACK: [1]
     Y             # Push variable `Y`, which is 2 by default
                   #  STACK: [1,2]
      T            # Push builtin 10
                   #  STACK: [1,2,10]
       V           # Pop and store it in variable `Y`
                   #  STACK: [1,2]
        X          # Push variable `X` again, which is 1 by default
                   #  STACK: [1,2,1]
         ι         # Uninterleave using the 2 and 1, resulting in ["2"]
                   #  STACK: [1,["2"]]
          @        # Check whether 1 is >= ["2"], resulting in [0]
                   #  STACK: [[0]]
           n       # Square it
                   #  STACK: [[0]]
            f      # Get a list of all prime factors (none for 0), which results in []
                   #  STACK: [[[]]]
             g     # Pop and push its length
                   #  STACK: [1]
              T    # Push builtin 10
                   #  STACK: [1,10]
               g   # Pop and push its length
                   #  STACK: [1,2]
                \  # Discard it
                   #  STACK: [1]
                 V # Pop and store it in variable `Y`
                   #  STACK: []

From here on out I can't really explain it anymore, since it does things I wasn't expecting:
ι                  # Uninterleave (would take either one or two arguments, but since the
                   # stack is empty, it somehow remembered the 1 that was previously on
                   # the stack and results in ["1"] -
                   # A program `ι` without input would result in an error instead..)
                   #  STACK: [["1"]]
 i                 # If-statement, which will be entered if the top is 1;
                   # since it's ["1"] instead of 1, it won't enter
                   #  STACK: []
  b\Wι`T\a₂Fge\aZNPT₃nFlfgX`!bhg!ce\ag₂$₃.pp
                   #  No-ops within the if-statement
                   # It again somehow remembers the previous ["1"] that was on the stack,
                   # which is output implicitly as result

Ok, nevermind, the perl one didn't take the most effort, this did.

@PkmnQ Tbh, it wasn't that much effort. :) I simply created the Java program, and then first used this program to check all possible variations of decreasing codepoints using ASCII encoding (which weren't very useful), and then I used this program to check all possible variations of decreasing codepoints using 05AB1E's encoding, for which this -13 resulted conveniently in ["1"]. Writing the explanation above took more effort to be completely honest. ;)

And if none of those would have worked, I could have changed the class-name M to something more convenient to try and make it output 1.

05AB1E, 3 bytes
1*1

(Works in Japt too.)
Try it online!
Japt, 3 bytes
6/6

Try it online!
Derived from the 05AB1E program by shifting by 5 Unicode codepoints.
The Japt program performs division, but don't be fooled into thinking that the 05AB1E program is performing multiplication. The * (square) operator acts only on the first 1; the output is actually just an implicit print of the second 1.
The same idea works with the 05AB1E/Japt program pairs 1-1 and 3/3 (shift 2) and 1+1 and 5/5 (shift 4).

It can indeed be done in 1 byte, but I like your approach more. :) Maybe this challenge should have been [tag:code-bowling] instead of [tag:code-golf], since that's much more impressive imo.

@KevinCruijssen Thanks. I agree it's not particularly impressive, especially since it was a complete stab in the dark - it just happened to work in the first two languages I picked! Very lucky choice :)

@KevinCruijssen Code bowling will quickly break with two programs of arbitrary length, each being a repetition of single built-in.

@Bubbler Good point. Creating a good code-bowling challenge is also pretty hard to begin with, since there are so many edge-cases you have to keep in mind.

Python 3, 19 17 bytes
-2 bytes thanks to Jonathan Allan
#]pal )!␛
exit(1)

Try it online!
Shifted +8
+exit(1)#␒m␣q|091

Try it online!
where ␛, ␒ and ␣ are literal \x1b, \x12 and \x80 bytes respectively.
Not much by the way of trickery going on here except prepending the print in the shift version with a + so that when we shift it the first character of the second program to the # character it doesn't send any characters into a negative codepoint (if we naïvely shifted e back to #, ( would be sent to \x- which doesn't exist). Outputs by exit code.

If you output via exit code you save 2 bytes: +exit(1)#□m□q|091.

@JonathanAllan Thanks! Avoids the error too because you exit first - nice.

05AB1E, 2x 1 byte
Without an input, any of these single characters will output 1, so just pick two you like. :)

1 (self explanatory): Try it online.
X (variable, which is 1 by default): Try it online.
≠ (!= 1 check; without input it will do "" != 1, resulting in truthy/1): Try it online.
@ (>= check; without input it will do "" >= "", resulting in truthy/1): Try it online.
Q (== check; without input it will do "" == "", resulting in truthy/1): Try it online.

APL (Dyalog Unicode), 2x2 bytes
*0
+1

Try it online!
*0 computes e^0, and +1 computes complex conjugate of 1. *0 has Unicode codepoint 42 and 48, and +1 has 43 and 49, so the two are different by exactly one.
Also works in many different flavors of APL, including... (copied from Adám's APL bounty)

Dyalog APL Classic/Unicode/Extended/Prime, APL2, APL+, APLSE, GNU/APL, Sharp APL, sAPL, SAX, NARS, APLX, A+, dzaima/APL, ngn/APL, APL\iv, Watcom APL, or APL\360.

... which makes this a polyglot of at least 19 languages!

A whole lot more languages.

That's beautiful.

Also works in Jelly

Unary, 84 bytes
000000000000000000000000000000000000000000000000000000000000000000000000000000000000

Outputs the character with codepoint 1 (equivalent brainfuck: +.). Since Unary cares only about the length of the program, a shift of any number will not change the output.

This comes very close to violating a standard loophole:Using a language's lack of features to trivialize a challenge

@Brian I wouldn't call "cares only about the length of the program" a lack of features: a Unary program can do anything a Brainfuck program can do (and Brainfuck is a Turing complete language), even though the Unary program is usually long enough its length has to be expressed in scientific notation.

I do appreciate that other users are making an effort to check the validity of my answer, though.

HTML, 8 bytes

05AB1E, 8 bytes
!TQ#!QN#

Try it online!

Jelly, 8 bytes
([X*(XU*

Try it online!

Jelly, 8 bytes
5he75eb7

Try it online!

Jelly, 8 bytes
;nk=;kh=

Try it online!

05AB1E, 8 bytes
@spB@pmB

Try it online!

Jelly, 8 bytes
H{xJHxuJ

Try it online!

05AB1E, 8 bytes
Outputs ["1"].
Q„SQ~S

Try it online!

05AB1E, 8 bytes
V‰†XV†ƒX

Try it online!

05AB1E, 8 bytes
X‹ˆZXˆ…Z

Try it online!

05AB1E, 8 bytes
]_]Š_

Try it online!

05AB1E, 8 bytes
a”‘ca‘Žc

Try it online!

05AB1E, 8 bytes
e˜•ge•’g

Try it online!

05AB1E, 8 bytes
kž›mk›˜m

Try it online!

("Pffffft! Of course I know how 05AB1E and Jelly work! I totally didn't just brute-force a bunch of combinations on TIO. That would be crazy! It would never work!")

So many! You deserve to be accepted as the best answer. Unfortunately, I'm not the one who made this question

CSS, 48 bytes

body:after{content:"1"}z|ancx9`esdqzbnmsdms9!0!|

cpez;bgufs|dpoufou;#2#~{}body:after{content:"1"}

The second code is not even close to valid CSS, but CSS parsers are so lax it works. Wow.

!@#$%^&*()_+, 4 bytes
1@/>

Try it online!
Explanation
1    # Pushes 1
 @   # Prints top of the stack (1)
  /> # Pushes some meaningless stuff

Shifted +2
3B1@

Try it online!
Explanation
3B   # Pushes some meaningless stuff
  1  # Pushes 1
   @ # Prints top of the stack (1)

Pyth, 2 bytes
s1

Try it online!
Pyth, 2 bytes, Shifted +1
t2

Try it online!

First Program translates to floor(1)
Second Program translates to 2 - 1

Whitespace, 2 x 18 bytes
" " " ␋ ␌
␋   ␌
" ␋

Try it online..
All codepoints decreased by 2 will result in:
 ␟ ␟ ␟  ␇
␈   ␇
␈ ␟ ␇

Try it online.
Both programs contain unprintables. The first program contains characters with the codepoints: [34,32,34,32,34,32,11,9,12,10,11,9,12,10,34,32,11,9]. The second program with codepoints: [32,30,32,30,32,30,9,7,10,8,9,7,10,8,32,30,9,7]. In Whitespace, all characters except for spaces (codepoint 32), tabs (codepoint 9), and newlines (codepoint 10) are ignored, so both programs are actually the following:
SSSTN
TN
ST

Where S, T, and N are spaces, tabs, and newlines respectively.
This program will:

SSSTN: Push 1
TNST: Print it as integer to STDOUT

It's actually possible to create 3 x 27 bytes, 4 x 36 bytes, and even 5 x 45 bytes programs by having the codepoints apart by 2, still resulting in the same basic program above after all non-whitespace characters are ignored.

Does anyone know how to display unprintables in a stackexchange answer? IIRC I've seen it in an answer here on codegolf once before, but I have no idea what markup to use to accomplish it anymore.

We used the characters from the Control Pictures block in Add a language to a polyglot to represent ESC, formfeed and vertical tab.
Including a hexdump is probably the better option.

@Potato44 Thanks. Added the unicode unprintable characters to my answer. :)

J, 3 2 bytes
=0

Monadic = means self-classify. It compares each item with each other item to see if it's the same. 0 is 0. It returns 1.
Shifted +1
>1

Unboxes 1, which does nothing, because it wasn't in a box in the first place.
Alternate 2-byters:
!1 (1 factorial) shifted by 2 is #3 (amount of items in 3)
!0 (0 factorial) shifted by 2 is #2 (amount of items in 2) shifted by 7 is *9 (sign of 9)

2 bytes: !1 → #3

Also !0 → *9

@Adám Didn't see your comments while editing. I'll add those as alternate 2-byters.

3 programs with !0 -> #2 -> *9

That also means #1 and *8, and #0 and *7 are also valid pairs.

JavaScript (web), 19 bytes
Form #1
`kdqs_0_:`;alert`1`

Form #2 (#1 shifted by +1)
alert`1`;a<bmfsua2a

This took me longer than what I'd like to admit, but it was a fun challenge.
Form #2 throws a ReferenceError, but that seems to be allowed.

brainfuck, 3 bytes
Outputs the character with the codepoint 1. This is allowed by default.
(+.

Try it online!
Shifted +3
+.1

Try it online!
Explanation
The + character increments the current item of the tape, and . outputs that value as a character. All other characters are ignored.

Polyglot, 3 bytes
Shift of 2. Works in R, Octave, Japt, and probably others.
1+0
3-2

Try it online (Octave)
Try it online (R)
Try it online (Japt)

Japt, 1 byte
Among many others:
1

Test it
Ä

Test it
l

Test it

R, 4 bytes
\061\043\030\077

(octal bytes, equivalent to: '1' '#' CAN '?')
Shifted -14:
\043\025\012\061

(octal bytes, equivalent to '#' NAK LF '1')
Unshifted program consists of number 1 (which is outputted unchanged), followed by # (comment character) and 'comments' of CAN (ASCII code \030) and '?'.
Shifted +14 program consists of # (comment character) and 'comment' of NAK (ASCII code \025), followed by a new line.  On the next line is the number 1 (which is outputted unchanged).
Test at bash command-line using echo (or gecho):
echo -e '\061\043\030\077' >prog1.r
echo -e '\043\025\012\061' >prog2.r
Rscript prog1.r
# [1] 1
Rscript prog2.r
# [1] 1

Io, 6 bytes
1print

Try it online!
Commentator, (Shifted -17)
 _aX]c

Try it online!

...I'm interested in learning commentator now.

naz, 4 bytes
1a1o

Explanation
1a # Add 1 to the register
1o # Output once

05AB1E, 4 bytes
2b2p

A shift of 1 Unicode codepoint forward from the original.
Explanation
2    # Push 2
 b   # Convert to binary
  2  # Push 2
   p # Push isPrime(2)
# ...after which the result is output implicitly

Jelly, 1 byte
¬ (logical NOT) vs ‘ (increment)
Try ¬ online! or Try ‘ online!
This works because given no input a Jelly program has a default argument of 0.
There are \$\binom{21}{2}=210\$ different pairs of single-byte programs to choose from since there are \$21\$ single bytes on Jelly's code-page which yield 1 with no input:

Keg, 1 byte (SBCS)
1

Try it online!
Implicitly outputs 1
Shifted +198

Try it online!
Uses the push'n'print to print 1

Batch, 27 17 bytes
:_]bi�+�4
@echo 1

The : introduces a label of unprintables, so the line is ignored, and the second line prints 1. Shifted by 6:
@echo 1
:�Fkinu&7

Much the same, except this time the second line is ignored.
Unfortunately I've mangled the unprintables. Sorry about that. Feel free to fix it.

Was waiting for a batch one to come around! Well done.

;#+, 4 bytes
9n;p

Try it online!
;#+, 4 bytes, Shift +2
;p=r

Try it online!

Explanation
; - increments the counter
p - outputs the counter as a number
9, n, = and r are not commands in ;#+ so they can be ignored.

V (vim), 6 bytes
i1<esc><nul>h0

Original: Try it online!
Shifted: Try it online!

bc (?), 3 bytes
1+0

Shift 2:
3-2

Use as echo 1+0 | bc in bash.

Hexagony, 5 bytes
=-1!@

Try it online!
Hexagony, 5 bytes, Shifted -12
1!%4

Hexdump:
00000000  31 21 25 15 34     |1!%.4|

Try it online!
Explanation
Because of the small size and lack of mirrors, the programs are mostly executed linearly.
Non-shifted Program
=       Reverse direction of memory pointer
 -      Sets the current memory edge to the difference of the left and right neighbors (0 - 0 = 0)
  1     Multiply current memory edge by 10 then add 1 (0 * 10 + 1 = 1)
   !    Outputs the value of current memory edge to stdout as an integer
    @   Terminate the program

Shifted Program
1       Multiply current memory edge by 10 then add 1 (0 * 10 + 1 = 1)
 !      Outputs the value of current memory edge to stdout as an integer
  %     Sets the current memory edge to the modulo of the left and right neighbours
        (1 % 0) causes program to exit because of division by 0
    4   Does not matter since the program as already exited

pdfTeX -halt-on-error, 1 byte
_

and
^

Both versions will throw an error as _ and ^ are only allowed in math-mode. Will return a 1 as exit code (due to the error).

Perl 5 -p, 8 bytes + 1 byte/keypress input = 9 bytes
Edit: -2 bytes and much nicer printable programs thanks to Dom Hastings
Each program requires input of 1 byte, or a single carriage-return keypress.
I've counted this as +1 byte, but I'm not terribly sure how valid this is...
$_++#^**

Try it online!
Shifted +1:
%`,,$_++

Try it online!
One might (validly) argue that since the extra input/keypress is part of the byte-count, it should also be shifted along with the codepoints of the program.  Fortunately, there are inputs for which this works Ok:
echo 'a' | perl -pe '$_++#^**'
# 1
echo 'b' | perl -pe '%`,,$_++'
# 1

Nice, I did look into this, but wasn't sure about input being valid either... If it is, you can use a shift of 1 (again, lets avoid unprintables :P) for these two: https://tio.run/##K0gtyjH9/18lXltbOU5L6/9/rn/5BSWZ@XnF/3ULAA https://tio.run/##K0gtyjH9/181QUdHJV5b@/9/rn/5BSWZ@XnF/3ULAA

Those versions are a big improvement!  I'm very ashamed that I didn't find that solution, which is much nicer (especially for the printability).  Will update answer with acknowledgement, while anyway cautiously waiting to see whether there's any consensus about (non-) validity...

No problem! I'm sure there was a consensus about this a while ago, but I couldn't find the right meta post... Perl's syntax is frighteningly forgiving, $` is probably a syntax error in more utility languages than it's not! I'm enjoying this challenge...

JavaScript, 3
3-2 becomes 2,1 shifted by -1.
1+0 becomes 2,1 shifted by +1.
Which is cool because 1+0 shifted by one becomes 2,1 shifted by one becomes 3-2 all three produce 1

let code = '1+0';
console.log (code, eval(code));
code = code.split('').map(c => String.fromCharCode(c.charCodeAt(0) + 1)).join('');
console.log (code, eval(code));
code = code.split('').map(c => String.fromCharCode(c.charCodeAt(0) + 1)).join('');
console.log (code, eval(code));

Would this work, and be the same size, for any sngle digit integers (a,b) where a=b+1?

@ouflak No, because in the case of 2,1 the expression evaluates to the second value, which has to be one. It only works with 0 and 2.

This isn't actually outputting anything though. Are you sure you don't mean a Javascript REPL rather than actual Javascript?

CJam, 1 byte
1
X

For whatever reason, CJam has X as a builtin for 1, and since it outputs implicitly, you can just use those two. However, I thought it'd be more interesting to find a 2-byte solution.
XR

Try it online!
Offset by +38:
2,

Try it online!
Explanations:

X    Push 1 to the stack
 R   Push an empty array to the stack
     (implicit) Output the stack

2    Push 2 to the stack
 ,   Pop and push range from 0 to 1 less than the popped number
     (implicit) Output the stack

Note that this is not only my first time golfing, but also my first time coding a program (well, programs) in CJam, so let me know how I did!

TI-BASIC, 2 bytes
not(0

iPart(1

Both display 1. Using one-byte TI-BASIC tokens and their hexadecimal values. not( has a value of 0xB8, iPart( has a value of 0xB9, 0 has a value of 0x30, and 1 has a value of 0x31.

Alternatives (assuming fresh state on calculator):

2 bytes: not(A and e^(H
2 bytes: e^(A and 10^(C
2 bytes: not(A and 10^(J
2 bytes: e^(A and cosh(L
2 bytes: 10^(A and cosh(J
2 bytes: int(1 and 10^(A
2 bytes: int(1 and cosh(J
2 bytes: abs(1 and cosh(I
2 bytes: iPart(1 and cosh(B
2 bytes: not(0 and cosh(B

Brainetry, 23 bytes
Golfed version (both lines end with a space):
# # # #
# # # # # # #

We must shift the #s so they become spaces  for the program to work again, so the required shift is -3.
The base program from which I derived the above:
This Brainetry program takes
no input and prints the codepoint 1.

Stax, 1 bytes
æ

Run and debug it
Stax, 1 bytes
1

Run and debug it
I'm not sure what the offset is, but any two single-character programs can be shifted to each other.

Turing Machine Code, 19 bytes
0 _ 1 r 1
1!'!2!s!2

Try it online!
Nothing too fancy. If the code is shifted by -1, the second line transforms into the code of the first line. The first line transforms into an unexecutable bit of code. The interpreter can, and does, run just fine with unexecutable code dispersed here and there, and so it is just executing the same code either way.

Perl -M5.010, 13 bytes
Perl 5, 21 bytes
 say 1#BELp^vGS.

BEL = ASCII 'BEL' character, octal byte \0007
GS = ASCII 'GS' character, octal byte \0035
Shifted +3:
#vd|#4&
say 1

Same approach as my R answer, but with slightly (+4 characters) more verbose outputting in Perl -M5.010.
Equivalent Perl 5 program-pair (using print instead of say) is print 1#BELmofkqGS. and, shifted +3, #sulqw#4&LFprint 1.
Test at bash command-line using echo (or gecho):
echo -e ' say 1#\0007p^v\0035.' > prog1.pl
echo -e '#vd|#4&\0012say 1' > prog2.pl
perl -M5.010 prog1.pl
# 1
perl -M5.010 prog2.pl
# 1

Perl 5 + -M5.10.0, 11 bytes
Uses a shift of 3.
p^v,, say//

Try it online!
say//#vd|22

Try it online!
Explanation
p^v computes the bitwise XOR of p and v then calls say//. // returns 1 because the empty string exists within $_ (which is the empty string).
In the shifted program, say// is called immediately and the rest of the program is commented out.

Really nice that you've managed to avoid non-printable characters.

Thanks! The a made it more tricky than I'd have liked, print would have been much easier!

Retina, 1 byte
^

Try it online!
Shifted by 30:
|

Try it online!

PHP + -d output_buffering=on, 21 bytes
<?=1;#;><*na^bkd`m'(:

Try it online!
Shifted by 1:
=@>2<$<?=+ob_clean();

Try it online!
Using the same technique as my Shifting Oritented Programming answer, it's possible to get all 256 shifts for 5,366 bytes:
Try it online!

Befunge-93, 7 bytes
Original code:
>1.@B03

Try it online!
Shifted by -2:
</,>@.1

Try it online!

You don't have to have a separate character for >/< when you can turn the 1 into <, e.g. 1.@5#& shifted by 11

><> x2, 6 bytes
Uses a shift of 11.
1n;0c&

Puts 1 on the stack, outputs it as a number and stops.
<yF;n1

< makes the direction change and start executing code from the end of the line. Puts 1 on the stack, outputs it as a number and stops.

@JoKing you're right, that's better. Edited, thanks !

Actually, you can do one byte better by not swapping directions at all and reusing the ; as a 1. 1n;xE shifted by -10 to get 'd1n;

Javastack , 1 byte
1

Vyxal, 1 byte
Vyxal pads the stack with 0s when there's no input, so the list includes but is not limited to...

› - 0 incremented
ċ - 0 != 1
≥ - 0 >= 0
≤ - 0 <= 0
= - 0 == 0
¬ - !0
₃ - 0 % 3 == 0
₂ - 0 % 2 == 0
₅ - 0 % 5 == 0
L - len(str(0))
⌐ - 1 - 0
e - 0 ** 0
ż, if I can output in a singleton list

Actually, 1 in Vyxal wouldn't be valid for this challenge, because there needs to be a shift of at least 1 in the codepoints of the two programs

@exedraj Oh true

@pxeger Any of the chars in the Vyxal list

Oh I missed that it could be a different langauge

TypeScript's type system, 8 bytes
type F=1

Vyxal 2, 8 bytes
‹←↓u0VMA

Try it Online!
Each character is offset by +16 in Vyxal 2's codepage.
The TypeScript program actually outputs 1 in Vyxal as well, but the shift must be nonzero.
The TypeScript type system program was very easy to write. I found the Vyxal program using this code, changing the offset by 1 and rerunning until I found a working program.
The first 6 characters of the Vyxal program do nothing particularly logical, but end up with 0 on the stack (which is quite common for random characters with no particular meaning). M tries to map over a list by a function, but with no list or function given, it just outputs an empty list. A checks if all items in the list are truthy, which for an empty list returns 1.

Same code for javascript and brainfuck (shifted 0)
JavaScript (V8), 152 bytes
+[+[+[+[+[+[+[+[+[+[+[+[+[+[+[+[+[+[+[+[+[+[+[+[+[+[+[+[+[+[+[+[+[+[+[+[+[+[+[+[+[+[+[+[+[+[+[+[+[1.>>0]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]

Try it online!
brainfuck, 152 bytes
+[+[+[+[+[+[+[+[+[+[+[+[+[+[+[+[+[+[+[+[+[+[+[+[+[+[+[+[+[+[+[+[+[+[+[+[+[+[+[+[+[+[+[+[+[+[+[+[+[1.>>0]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]

Try it online!

For which non-zero codepoint shift does it output 1?

Shift must be non-zero :/

If it's shifted zero then it's just a polyglot

Text, 1 byte
1

①

Ⅰ

If one is valid then there's no reason ① and Ⅰ aren't

Add other expressions of 1 in one character here