text:
Smallest Word Search Puzzle
A word search is a matrix of letters as defined in Word Search Puzzle Generation. For a word search to contain a word, it means that that word appears somewhere in the matrix horizontally, vertically, or diagonally.
Your task is to write a program that takes a list of strings and outputs the dimensions of the smallest-area word search that contains those strings.
Specifications

You can assume the word search and the input strings consist of only lowercase ASCII letters.
You can output the dimensions in either order (y x instead of x y) because it doesn't matter to the word search.
This is code-golf, so the shortest valid solution (in bytes) wins.

Test Cases
word                     -> 4 1
hello, e                 -> 5 1
hello, f                 -> 6 1
small, llama             -> 8 1
words, other             -> 5 2
words, order, about, orb -> 5 3

I'm not convinced that makes a meaningful difference? Do you have any reason to suspect any algorithm that would be competitive here and not if you had to print it?

Actually, there's a fairly major difference: that challenge asked for squares, this one for rectangles, and that may well make a large difference. If not for that, though, I'd call it a duplicate; the difference in output format might change which language wins, but it's unlikely to change the non-output part of the algorithms.

None of the test cases include diagonals, you should probably add one for that.

Wouldn't hello, f be 6 1 ? 6x1 is smaller than 5x2

@SLC Yes, edited.

This is till a dupe as trivial edits to get an answer

@ChristopherPeart as ais523 pointed out, that challenged asked strictly for square matrices, while this one asked for arbitrary rectangles, so algorithms that worked for that challenge might not work for this one. That said, I suppose it's similar enough that it might be marked as a duplicate.

³L jelly 2 bytes words must just be put in as one long word. :P


text:
Bitflip-resistant composite numbers
Sometimes, when writing a program, you need to use a prime number for some reason or other (e.g. cryptography). I assume that sometimes, you need to use a composite number, too. Sometimes, at least here on PPCG, your program has to be able to deal with arbitrary changes. And in circumstances conveniently contrived to make an interesting PPCG question, perhaps even the numbers you're using have to be resistant to corruption…
Definitions
A composite number is an integer ≥ 4 that isn't prime, i.e. it is the product of two smaller integers greater than 1. A bitflip-resistant composite number is defined as follows: it's a composite positive integer for which, if you write it in binary in the minimum possible number of bits, you can change any one or two bits from the number, and the number is still composite.
Example
For example, consider the number 84. In binary, that's 1010100. Here are all the numbers which differ by no more than 2 bits from that:

0000100    4   2×2
0010000   16   4×4
0010100   20   4×5
0010101   21   3×7
0010110   22   2×11
0011100   28   4×7
0110100   52   4×13
1000000   64   8×8
1000100   68   4×17
1000101   69   3×23
1000110   70   7×10
1001100   76   4×19
1010000   80   8×10
1010001   81   9×9
1010010   82   2×41
1010100   84   7×12
1010101   85   5×17
1010110   86   2×43
1010111   87   3×29
1011000   88   8×11
1011100   92   4×23
1011101   93   3×31
1011110   94   2×47
1100100  100  10×10
1110000  112   8×14
1110100  116   4×29
1110101  117   9×13
1110110  118   2×59
1111100  124   4×31

The first column is the number in binary; the second column is the number in decimal. As the third column indicates, all of these numbers are composite. As such, 84 is a bitflip-resistant composite number.
The task
You must write one of the following three programs or functions, whichever makes the most sense for your language:

A program or function that takes a nonnegative integer n as input, and outputs the first n bitflip-resistant composite numbers.
A program or function that takes a nonnegative integer n as input, and outputs all bitflip-resistant composite numbers less than n (or if you prefer, less than or equal to n, i.e. you can choose whether n is included in the output if bitflip-resistant).
A program or function that takes no input, and outputs all bitflip-resistant composite numbers. (This must use an output mechanism capable of producing output while the program is still running, such as printing to stdout, a lazy list, or a generator; you can't just calculate the entire list and then print it.)

Test cases
Here are the first few bitflip-resistant composite numbers:
84, 184, 246, 252, 324, 342, 424, 468, 588, 636, 664, 670, 712, 730, 934, 958

Clarifications

It's only the numbers you produce that have to be resistant to bitflips. This isn't a task about making the program that finds them resistant to bitflips; use whatever numbers in the program itself that you like.
The numbers you output don't have to be resistant to a bitflip in the "leading zeroes"; imagine that the numbers will be stored in the minimum possible number of bits, and only those bits have to be immune to flipping. However, the initial 1 bits on the numbers you output do have to be immune to bitflips.
Use any algorithm you like that produces the right result; you aren't being marked on efficiency here.
If you can prove that there are finitely many bitflip-resistant composite numbers, then a) the restrictions on output format are lifted, and b) hardcoding the list will be allowed (although probably more verbose than just calculating it). This rule is mostly just for completeness; I don't expect it to be relevant.

Victory condition
This is code-golf, so as usual, shorter is better. Also as usual, the length of the program will be measured in bytes.

"A program or function that takes a nonnegative integer n as input, and outputs all bitflip-resistant composite numbers less than n" - can I include n if n is bitflip-resistant? (i.e. make it "less than or equal to n"?)

Let us continue this discussion in chat.

I like how clear and thorough your specs usually are

With all that talk at the beginning about being resistant to corruption, I thought this was going to be another nearly impossible radiation-hardening challenge...

@ETHproductions: I actually avoided the term "radiation hardening" explicitly in an attempt to avoid misleading PPCG regulars, although I realised it was inevitably going to happen anyway. Although, now you've got me wondering about what a program that was resistant to bitflips would be like…

@ais523 It'd look like the empty program. The set of all empty programs.

Jelly, 20? 22 bytes
BµJŒċ;0Ṭ^µḄµÆPoỊṀ¬
⁴Ç#

Try it online!
Yields the first n such numbers.
Maybe the ;0 can be removed (without it we don't check if the number itself is composite - are there any primes with all bit-flips composite?)
Note that it is not sufficient to perform the test not(any(is prime)) to the set of bit-flipped numbers. We must also test that 0 is not in the set.
This is because 0 is not prime and not composite (1 is too, but see below).
The need to check for 0 may be seen by a counter-example:

131136 (217+26) has the following bit-flip set:

[0, 64, 65, 66, 68, 72, 80, 96, 192, 320, 576, 1088, 2112, 4160, 8256, 16448, 32832, 65600, 131072, 131073, 131074, 131076, 131080, 131088, 131104, 131136, 131137, 131138, 131139, 131140, 131141, 131142, 131144, 131145, 131146, 131148, 131152, 131153, 131154, 131156, 131160, 131168, 131169, 131170, 131172, 131176, 131184, 131200, 131264, 131265, 131266, 131268, 131272, 131280, 131296, 131328, 131392, 131393, 131394, 131396, 131400, 131408, 131424, 131520, 131584, 131648, 131649, 131650, 131652, 131656, 131664, 131680, 131776, 131904, 132096, 132160, 132161, 132162, 132164, 132168, 132176, 132192, 132288, 132416, 132672, 133120, 133184, 133185, 133186, 133188, 133192, 133200, 133216, 133312, 133440, 133696, 134208, 135168, 135232, 135233, 135234, 135236, 135240, 135248, 135264, 135360, 135488, 135744, 136256, 137280, 139264, 139328, 139329, 139330, 139332, 139336, 139344, 139360, 139456, 139584, 139840, 140352, 141376, 143424, 147456, 147520, 147521, 147522, 147524, 147528, 147536, 147552, 147648, 147776, 148032, 148544, 149568, 151616, 155712, 163840, 163904, 163905, 163906, 163908, 163912, 163920, 163936, 164032, 164160, 164416, 164928, 165952, 168000, 172096, 180288, 196608, 196672, 196673, 196674, 196676, 196680, 196688, 196704, 196800, 196928, 197184, 197696, 198720, 200768, 204864, 213056, 229440]

All of which, except 0 are composite, yet 0 is not prime.
1 is also non-prime and non-composite and could appear in the set. However we can, if we want, leave this as if it were a composite:

all inputs less than or equal to 3 (if being considered at all) contain a 0 anyway (in fact all less than 7 do).
to reach 1 in one bit flip the original number must be of the form 2k+20, and if this is greater than 3, i.e. k>1, then we can reach 3 by flipping off the k-bit and setting the 1-bit (21+20=3).
to reach 1 in two bit flips the original number must be of the form 2k and if this is greater than 3 we can reach 2 in two flips instead, and 2 is prime.

As it stands the code is handling both 0 and 1 together using the "insignificant" atom, Ị.
How?
⁴Ç# - Main link: n
⁴   - 16
  # - count up from 16 finding the first n matches of
 Ç  -     last link (1) as a monad

BµJŒċ;0Ṭ^µḄµÆPoỊṀ¬ - Link 1, test a number: i
B                  - convert to a binary list
 µ                 - start a new monadic chain
  J                - range(length): [1,2,...,nBits]
   Œċ              - pairs with replacement: [[1,1],[1,2],...,[1,nBits],[2,2],[2,3],...,[2,nBits],...,[nBits-1,nBits]]
     ;0            - concatenate a zero
       Ṭ           - untruth (makes lists with ones at those indexes - the [1,1], [2,2], etc make the one-flips, the zero makes the no-flip, the rest make the two-flips)
        ^          - exclusive or with the binary list version of i (flip the bits)
         µ         - start a new monadic chain
          Ḅ        - un-binary (get the integer values of each of the flipped versions)
           µ       - start a new monadic chain
            ÆP     - is prime? (make a list of 1s for primes and 0 for non-primes)
               Ị   - is insignificant (abs(v)<=1)
              o    - logical or (now we have true for any primes, 0 or 1 - hence non-composites)
                Ṁ  - maximum (1 if any non-composite was found)
                 ¬ - not (1 if all were composite)

Is the input included in your set of all numbers that differ by at most 2 bits? If so, it would check the compositeness of the input itself anyway.

No, that is why the ;0 is there - Œċ gets all unordered pairs with replacement of the indexes (J), so for 84, which has 7 bits that's 28 (including the likes of [1,1] for the single bit-flips (from the "with replacement" part), not 29 (plus no change).

It can be removed if we know that no prime exists such that all of it's bit-flipped cousins are composite; but I am not sure of that fact.

Brachylog, 32 38 bytes
2<≜.¬(ḃ↰₂↰₂~ḃ≜{ṗ|ℕ<2}∧)
k~k|tgT∧?k↰:Tc

Try it online!
This is a function/predicate ↰₀ that returns a generator that generates all such numbers. (The TIO link only prints the first number, so that something's observable. Running it locally has produced many more, though.)
Now updated to handle numbers which are within two bitflips of 0 or 1 (which are neither prime nor composite) correctly.
Explanation
Helper predicate ↰₂ (returns a list that's equal to the input, except for maybe one element)
k~k|tgT∧?k↰:Tc
   |            Either:
 ~k               the output is produced by appending an arbitrary element
k                 to the input minus its last element
                Or:
        ?k        take the input minus its last element,
          ↰       call this predicate recursively on that,
      T    :Tc    then append
     g            the singleton list consisting of
    t             the last element of the input

I'd love it if there were a terser way to do this relatively simple recursion, but I'm not sure there is yet; there are some promising-looking features in the specification, but they're marked as unimplemented.
Main program ↰₀
2<≜.¬(ḃ↰₂↰₂~ḃ≜{ṗ|ℕ<2}∧)
2<≜                      For each integer greater than 2
   .                     generate it if
    ¬(                )  it does not have the following property:
      ḃ                  converting it to binary,
       ↰₂↰₂              running the helper predicate twice,
           ~ḃ            and converting back to decimal
             ≜           does not allow us to find a specific value
              {     }    that is:
               ṗ           prime;
                |        or:
                 ℕ<2       nonnegative and less than 2
                     ∧   (disable an unwanted implicit constraint)

JavaScript (ES6), 96 bytes
A full program that prompts for the number of matching integers and displays them one by one, using alert().

for(i=prompt(n=2);i;n+=2)(g=b=>b>n?alert(n,i--):(C=(n,x=n)=>n%--x?C(n,x):x>1)(n^b|1)&&g(b*2))(1)

Unless your browser is set up to use Tail Call Optimization, this will eventually break because of a recursion overflow.
Below is a non-recursive version (102 bytes).
for(i=prompt(n=2);i;n+=2){for(c=b=1;b<n;b*=2,c&=C)for(C=k=2,x=n^b|1;k<x;k++)C|=!(x%k);c&&alert(n,i--)}

Assumption
This algorithm relies on the assumption that all bitflip-resistant composite numbers are even. This leads to a rather important simplification: instead of flipping every possible pair of bits, we only flip bit #0 and another one (or no other bit at all) and check that all resulting numbers are composite.
However, I can't figure out any obvious proof that an odd bitflip-resistant composite number doesn't actually exist. It just happens to never be the case for small numbers (I checked up to 1,000,000), and it seems like the probability of finding one is decreasing as the number of bits is increasing (but this is basically just my intuition about it).

Python 2, 113 bytes
r=range
lambda N:[n for n in r(1,N)if 1-any((bin(k).count('1')<3)*all((n^k)%q for q in r(2,n^k))for k in r(n+1))]

(The second line is an unnamed function which returns a list of all bitflip-resistant composite numbers which are less than the input to the function.)
The syntax all(u%q for q in range(2,u)) will evaluate to True whenever u is either prime or less than or equal to 2, and otherwise will evaluate to False.  (It is vacuously True if u is less than or equal to 2.)
In other words, all(u%q for q in range(2,u)) is equal to 0 if and only if u is composite.
If the function's input is less than 2, then function returns an empty list (as desired).  So assume the input N is at least 2, and suppose 1 <= n < N.  For each k from 0 through n (inclusive), the code will check whether n XOR'd with k is composite, and it also checks whether k has at most two 1's in its binary representation.  If n^k is composite, or if k has more than two 1's, then it moves on to the next value of k.  If it gets through all the values of k from 0 through n this way, then it includes n in the list.
On the other hand, if there's a value of k with at most two 1's such that n^k is not composite, then n is not included in the list.

Jelly, 20 17 bytes
BJŒċṬUḄ^;⁸ÆḍṂỊµÐḟ

Try it online!
How it works
BJŒċṬUḄ^;⁸ÆḍṂỊµÐḟ  Main link. Argument: n

              µ    Combine all links to the left into a chain.
               Ðḟ  Filter-false; keep only integers k from [1, ..., n] for which
                   the chain returns 0.
B                    Convert k to binary.
 J                   Get the indices of all digits.
  Œċ                 Take all combination of two indices, with replacement.
    Ṭ                Untruth; map each index pair [i, j] to the Boolean array of
                     length j that has 1's at (and only at) indices i and j.
     U               Upend; reverse each Boolean array.
      Ḅ              Unbinary; convert each array from base 2 to integer.
       ^             XOR the resulting numbers with k.
        ;⁸           Append k to the resulting list.
          Æḍ         Count the number of proper divisors of each result.
            Ṃ        Take the minimum.
             Ị       Insignificant; test if the minimum is 0 or 1.

Now I'm wondering what it says about me that I figured out how this works even with no explanation available (via reading your source code). I had a go at this question in Jelly, but didn't get very far (i.e. I had a working solution – it's what generated the list of test cases – but it was clearly far too verbose). What I was missing was the trick of producing the table of numbers-with-no-more-than-two-1-bits first, and then XORing it.

Mathematica, 115 bytes
1 4 byte saved thanks to @MartinEnder
Cases[4~Range~#,x_/;And@@CompositeQ[Fold[#+##&]/@Select[{0,1}~Tuples~BitLength@x,Tr@Abs[#-x~IntegerDigits~2]<3&]]]&

(* or *)

(s=Select)[4~Range~#,xAnd@@CompositeQ[Fold[#+##&]/@s[{0,1}~Tuples~BitLength@x,Tr@Abs[#-x~IntegerDigits~2]<3&]]]&

Very inefficient because it generates all numbers up to 2^ceil(lg(n)).
Second code uses U+F4A1 (Function function)

Perl 6, 87 85 bytes
{grep {!grep {$_%all 2..^$_},($_ X+^grep {.base(2)~~m:g/1/ <3},^(2+<.log(2)))},2..$_}

Returns all such numbers that are smaller or equal to the input number.
How it works
For each number n from 2 to the input, it does the following:

^(2 +< .log(2))
Generates all non-negative integers that have the same or shorter bit length than n.
grep {.base(2) ~~ m:g/1/ < 3},
Filters numbers from this list that have less than three bits set (using a regex).
$_ X+^
XOR's n with each of those numbers, yielding all valid "mutations" of n.
!grep {$_ % all 2..^$_}
Only lets n be part of the output list if none of the mutations are non-composite (checked by taking each mutation x modulo an all-Junction of numbers between 2 and x-1).

Floroid, 95 109 bytes
Bj:[n KnIw(j)Fp(Cao(hm("".y(k)))Mhm("".y(k))>1KkIcd("10"*Z(hi(n)),Z(hi(n)))FT(a!=b Ka,bIq(hi(n),"".y(k)))<3)]

Returns a list of bitflip-resistant numbers up to input - 1. Handles the edgy situations (0 and 1) as well.
Floroid is an old language of mine, that I have used only a couple of times. Haven't touched it for a loooong time, hence the size of the program.
Translates to the following Python code, which I think could be reduced with recursion.
lambda j:[n for n in  range(j) if  all( not  functions.isPrime( functions.fromBinStr("".join(k))) and  functions.fromBinStr("".join(k))>1for k in  functions.combinations_with_replacement("10"*len( functions.pureBin(n)),len( functions.pureBin(n))) if sum (a!=b for a,b in  zip( functions.pureBin(n),"".join(k)))<3)]

Each function used here is predefined in Floroid. This page contains all of the functions and their definitions.

Just as a note: there are some numbers (0 and 1) that aren't prime, but aren't composite either. A few of the solutions have had to be corrected because of that; I suspect this one will too.

@ais523 I actually read about that. Is there any known test case yet for such? Anyway, I'll fix mine, since it's (probably) prone to that too, thanks!

@TuukaX: 131136 has 0 as the only non-composite value that can be reached via two bitflips (and 0 is not prime). Thanks to JonathanAllan for finding it.

MATL, 30 28 27 26 bytes
:GBnW:qtB!s3<)!Z~tZpw~+a~f

Try it online!
Outputs all bitflip-resistant composite numbers up to (and including) n.
Uses ideas from both Jelly solutions - only considers 0 as a problematic non-prime; and generates a list of numbers within a distance 2 first, then takes an xor.
Alternate solution, by looping (30 bytes):
:"@BnW:qt@Z~B!s3<)Zp1M~ha~?@D]

Outputs all bitflip-resistant composite numbers up to (and including) n.

MATL, 29 bytes
Thanks to Jonathan Allan for a correction.
q:Q"@BtnFTZ^=~!s3<fqt2>)Zp~?@

This takes a number n and outputs all bitflip-resistant composite numbers up to n.
How it works
Try it at MATL Online!
q:Q       % Input n implicitly. Push range [2 3 ... n]
"         % For each k in [2 3 ... n]
  @       %   Push k
  B       %   Convert to binary. Gives a row vector of zeros and ones, say v
  tn      %   Duplicate. Number of elements, say m
  FT      %   Push [0 1]
  Z^      %   Cartesian power of [0 1] raised to m. This gives a matrix,
          %   where each row is a binary number of length m
  =~      %   Compare with v, with broadcast
  !s      %   Sum of each row. Gives a row vector. This is the number of
          %   bit flips
  3<      %   True for numbers that are less than 3 bit flips away from k
  fq      %   Find their indices and subtract 1 to convert to decimal form.
          %   This gives a vector of numbers that are less than 3 bit flips
          %   away from k
  t2>)    %   Remove 0 or 1
  Zp~     %   Test each entry for non-primeness
?         % If all entries are true
  @       %   Push k
          % End (implicit)
          % Display stack (implicit)

CJam, 34 33 bytes
ri{_2b,,2\f#_m*::|0+f^:mp:+!},2>p

Calculates all bitflip-resistant composites strictly less than n.
Like Jonathan Allan, I'm not sure if it's actually necessary to check for 0 bitflips. If it turns out that no prime number has all of its bitflips result in composite numbers, the 0+ can be removed.
Try it online!
Explanation
ri                                 Take an integer from input (n)
  {                                Filter out all numbers in the range 0...n-1 for which
                                    the following block is false
   _                                 Duplicate the number
    2b,                              Convert to binary, get the length
       ,                             Range from 0 to length-1
        2\f#                         Map each number in that range as a power of 2
                                      results in all powers of 2 less than or equal to n
            _m*                      Cartesian product with itself
               ::|                   Reduce each Cartesian pair with btiwse OR
                                      results in all numbers that have 1-2 1 bits in binary
                  0+                 Add 0 to that list
                    f^               Bitwise XOR the number we're checking with each of these
                                      This computes all the bitflips
                      :mp            Map each result to 0 if it's prime, 1 if it's composite
                         :+!         Take the sum of the list, check if it's 0
                                      If it is, then none of the results were prime
                            },     (end of filter block)
                              2>   Discard the first 2 numbers, since 0 and 1 always pass
                                p  Print the list nicely

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:
Calculate Exponents bit by bit
Your task is to slowly calculate exponentiation, with the following steps:
Given two inputs (in this example, 4 and 8), you must calculate the exponentiation by calculate the equation bit by bit. You would do 4^8, have a greater base value (4) and a smaller exponent (8). You can do this using more exponentiation and division. You can divide the exponent by a value X (provided X is a prime divisor of the exponent), and make the base value (B) into B^X. For example, you can do:
4^8 = (4 ^ 2)^(8 / 2) = 16^4

I have replaced X with 2 in the previous equation.
You can 'simplify' 16^4 further, again with X = 2:
16^4 = (16 ^ 2)^(4 / 2) = 256^2

And then finally calculate a number (again, X = 2):
256^2 = (256 ^ 2)^(2 / 2) = 65536^1 = 65536

Therefore,
4^8 = 16^4 = 256^2 = 65536

This is the output you should give. The output separator is a little flexible, for example, you can separate the equations by newlines or spaces instead of =. Or, you may put them into a list (but you mustn't use a digit or the ^ character as a separator).
As Martin Ender pointed out, the ^ is also flexible. For example, you may use [A, B] or A**B instead of A^B in the output.
X may only be prime, which means you cannot use X = 8 to get straight to the solution, and the values of X will only be prime factors of the second input (the exponent).
Examples:
(input) -> (output)
4^8 -> 4^8=16^4=256^2=65536
5^11 -> 5^11=48828125
2^15 -> 2^15=32^3=32768 (2^15=8^5=32768 is also a valid output)

Mind that the input format is also flexible (eg you may take A \n B or A B instead of A^B. Obviously, this wouldn't be a problem if you write a function taking two arguments.
In the second example, we go straight to calculation, since 11 is prime and we cannot take any more steps.
You may write a program or a function to solve this, and you may print or return the value, respectively.
As this is code-golf, that shortest code wins!

@JonathanAllan I was looking at that too. 32^3 and 8^15 are not 512 either.

@JonathanAllan thanks for spotting that :)

@Okx the last one can be printed as x^1?

@Rod no, it can't. That would be silly.

Jelly, 16 bytes
*Uż:Ṫ
ÆfṪ1;×\ç@€

Try it online!
Input is a single list [base, exponent]. The return value of the lower monadic link is a list of lists, as a full program a representation of that list is printed, for example 2^15=8^5=32768^1 is printed as:
[[2, 15], [8, 5], [32768, 1]]

How?
ÆfṪ1;×\ç@€ - Main link: [base, exponent]            e.g.     [4,12]
Æf         - prime factorization array (vectorises)      [[2,2],[2,2,3]]
  Ṫ        - tail (tailing first costs bytes)                   [2,2,3]
   1;      - 1 concatenated with the result                   [1,2,2,3]
     ×\    - reduce with multiplication  (make factors)       [1,2,4,12]
       ç@€ - call last link (1) as a dyad for €ach with reversed @rguments
           - implicit print if running as a full program

*Uż:Ṫ - Link 1, an entry in the equality: [base, exponent], factor  e.g. [4, 12], 4
*     - exponentiate (vectorises) : [base ^ factor, exponent ^ factor]   [256, 20736]
 U    - upend                                                            [20736, 256]
   :  - integer division: [base // factor, exponent // factor]           [1, 3]
  ż   - zip                                                        [[20736, 1], [256, 3]]
    Ṫ - tail                                                                    [256, 3]
                                               ...i.e at a factor of 4: 4 ^ 12 = 256 ^ 3

It could be formatted as a grid for 2 bytes by a trailing µG, e.g.:
    2    15
    8     5
32768     1

...or fully formatted, including trimming off the ^1, for 9, with a trailing j€”^j”=ṖṖ, e.g.:
2^15=8^5=32768

JavaScript (ES7), 55 bytes
f=(a,b,c=2)=>b>1?b%c?f(a,b,c+1):a+['^'+b,f(a**c,b/c)]:a

Uses , in place of = (2^15,8^5,32768).
Test cases

f=(a,b,c=2)=>b>1?b%c?f(a,b,c+1):a+['^'+b,f(Math.pow(a,c),b/c)]:a
g=(a,b)=>console.log(`f(${a}, ${b}):`,f(a,b))

g(4,8)
g(5,11)
g(2,15)

Note: the snippet uses Math.pow instead of ** for cross-browser compatibility.

Firefox 54 nightly build supports ES7 100%! :O http://kangax.github.io/compat-table/es2016plus/#firefox54

05AB1E, 23 22 17 bytes
Saved 5 bytes by noticing the flexible output format.
Ò©gƒ²®N¹‚£P`Šm‚Rˆ

Try it online!
Explanation
Example for 2^15
Ò©                 # calculate primefactors of exponent and store in register
                   # STACK: [3,5]
  g                # length
                   # STACK: 2
   ƒ               # for N in range[0 ... len(primefactors)] do
    ²              # push base
                   # STACK: 2
     ®             # push primefactors
                   # STACK: 2, [3,5]
      N¹‚£         # split into 2 parts where the first is N items long
                   # 1st, 2nd, 3rd iteration: [[], [3, 5]] / [[3], [5]] / [[3, 5], []]
          P        # reduce each by product
                   # STACK 1st iteration: 2, [1,15]
           `       # split list to items on stack
                   # STACK 1st iteration: 2, 1, 15
            Š      # move down the current exponent
                   # STACK 1st iteration: 15, 2, 1
             m     # raise base to the rest of the full exponent
                   # STACK 1st iteration: 15, 2
              ‚    # pair them up
                   # STACK 1st iteration: [15,2]
               R   # reverse the pair
                   # STACK 1st iteration: [2,15]
                ˆ  # store it in global list
                   # print global list at the end of execution

C, 125 123 + 4 (-lm) = 129 127 bytes
i;f(n,m)double n;{if(m-1){printf("%.0f^%d=",n,m);for(i=2;i<=m;i++)if(!(m%i))return f(pow(n,i),m/i);}else printf("%.0f",n);}

Takes a double and an integer.
Try it online!

Haskell, 64 bytes
a#b|v:_<-[x|x<-[2..b],mod b x<1]=[a,b]:(a^v)#div b v|1<2=[[a^b]]

Usage example: 2 # 32 -> [[2,32],[4,16],[16,8],[256,4],[65536,2],[4294967296]]. Try it online!.
How it works:
a#b                       -- take input numbers a and b
   |                      -- if
      [x|x<-[2..b]   ]    --  the list of all x drawn from [2..b]
              ,mod b x<1  --  where x divides b
    v:_<-                 --  has at least one element (bind the first to v)
       = [a,b]:           --  the the result is the [a,b] followed by
          (a^v)#div b v   --  a recursive call with parameters (a^v) and (div b v)
   |1<2                   -- else (i.e. no divisors of b)
       = [[a^b]]          --  the result is the singleton list of a singleton list
                          --    of a^b

Bash + GNU utilities, 82
echo $1^$2
f=`factor $2|egrep -o "\S+$"`
((m=$2/f,r=$1**f,m-1))&&$0 $r $m||echo $r

Recursive shell script.  This doesn't seem to work in TIO, but runs fine when saved as a script and executed:
$ ./expbit2.sh 4 8
4^8
16^4
256^2
65536
$ ./expbit2.sh 5 11
5^11
48828125
$ ./expbit2.sh 2 15
2^15
32^3
32768
$

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


text:
Do the figures fit?
Challenge
Make the shortest program to determine if the figures in the input will fit into the space in the input.
Requirements
The input will be in the format of this example:
Input:
+----+      -- +--+
|    +----+    |  |
|         |    +--+
|         |
+---------+

Output:
+----+
|+--++----+
||  |--   |
|+--+     |
+---------+

First, starting in the upper left corner, is the space that the program will try to fit the figures into. Then there is a space. Then there is a figure, in this case two dashes. Then there is a space, then a second figure. The output is the figures fitted inside of the space.
Rules about figures and input:

The upper left corner of a shape will always be on the first row.
After a figure, there is one space, as shown in the example.
There is no limit on the size of the figures.
The first figure will always be the space that the program will determine if the figures fit into.
There is no limit on the number of figures, but there will only be one space to fit them into.
All figures will be made of | and - for the sides and + for the corners. These are the only characters used besides spaces and newlines.
Figures cannot be rotated.
Borders cannot overlap.
You may fit one figure inside of another.
The figures do not have to be closed.
The space will always be closed.
The space does not have to be completely filled.
You may not split up shapes.

Rules about output:

If the figures fit into the space, the program should output the figures inside of the space, as shown above. It does not matter how they are arranged, as long as no borders overlap, all figures are correct, and no shapes are split up.
If the figures do not fit, output "no".

Examples
Input:
+--+ |
+--+

Output:
no

Input:
+---+  -+
|   |   |
|   |
+---+

Output:
+---+
|-+ |
| | |
+---+

This is also valid:
+---+
| -+|
|  ||
+---+

Input:
+----------+ +-----+ -+
|          | |     |  |
|          | |     |
|          | +-----+
|          |
+----------+

Output:
+----------+
|+-----+   |
||-+   |   |
|| |   |   |
|+-----+   |
+----------+

This is a code golf, so the shortest answer wins.

You say make the shortest program at the top, but answer with most votes wins at the bottom. Note that this will get closed as a popularity contest.

This isn't a programming puzzle either. That has a fairly specific meaning; check the tag wiki for more information.

I fixed this. It is now a code golf challenge

Consider editing out the specific "no" output, and either (1) only having to handle valid input (any behaviour); or (2) allowing standard falsey outputs and errors.

It looks like the two -- are misplaced in one of the first two images [Requirements].

Which is the upper-left corner in ambiguous cases?

"The first figure will always be the space that the program will determine if the figures fit into." - can we not take the two figures separately? Parsing out the set of figures seems to detract from the main task.

If the case is ambiguous, the first character in the input will be the upper corner of the space. The program does not have to output anything if the input is invalid. It outputs "no" is the figures do not fit into the space.

Python 2, 529 692 683 681 bytes
L=len
R=range
def g(s):S=s.split('\n');S=[l.ljust(L(S[0]))for l in S];Z=zip(*S);I=[-1]+[i for i in R(L(Z))if{' '}==set(Z[i])]+[None];return[[list(x)for x in zip(*Z[I[i]+1:I[i+1]])if set(x)!={' '}]for i in R(L(I)-1)]
def f(s):
 S=g(s);G(S[0],1,1)
 for l in F(*S)or['no']:print''.join(l).replace('~',' ')
def G(a,i,j):
 if len(a)>i>-1<j<len(a[0])and'!'>a[i][j]:
	for x,y in(0,1),(0,-1),(1,0),(-1,0):G(a,i+x,j+y);a[i][j]='~'
def F(a,*s):
 if not s:return a
 c=s[0];h,w=L(c),L(c[0])
 for i in R(1,L(a)-h):
	for j in R(1,L(a[0])-w):
	 T=1;A=[l[:]for l in a]
	 for y in R(h):
		for x in R(w):
		 C=c[y][x]
		 if' '<C:T&=A[y+i][x+j]>'}';A[y+i][x+j]=C
	 r=T and F(A,*s[1:])
	 if r:return r

Try it online!
Gained a lot of bytes by adding a flood fill to the first shape.
This is to fix fix cases where a figure can be outside the shape, but inside its bounding box.
eg.
The shape fits inside the bounding box, but outside the shape:
Input:        Wrong:      Correct:
+-+    --     +-+         +-+
| |           | |--       | |
| +--+        | +--+      | +--+
|    |        |    |      |--  |
+----+        +----+      +----+

Explanation
f takes input as a single string with newlines.
+----+      -- +--+
|    +----+    |  |
|         |    +--+
|         |
+---------+

The shapes are split up with g(s) and mapped to lists of lists
[[['+', '-', '-', '-', '-', '+', ' ', ' ', ' ', ' ', ' '], ['|', ' ', ' ', ' ', ' ', '+', '-', '-', '-', '-', '+'], ['|', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '|'], ['|', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '|'], ['+', '-', '-', '-', '-', '-', '-', '-', '-', '-', '+']],
[['-', '-']],
[['+', '-', '-', '+'], ['|', ' ', ' ', '|'], ['+', '-', '-', '+']]]

The first shape is flood filled with ~ (G(S[0])), so we know the allowed area:
+----+
|~~~~+----+
|~~~~~~~~~|
|~~~~~~~~~|
+---------+

For each other shape we recursively fit them into the first F(a,*s), returning when all of them fit, or at the end, if no configuration does.
+----+        +----+        +----+        +----+        +----+
|--~~+----+   |~--~+----+   |~~--+----+   |~~~~+----+   |~~~~+----+
|~~~~~~~~~|   |~~~~~~~~~|   |~~~~~~~~~|   |--~~~~~~~|   |~--~~~~~~|
|~~~~~~~~~|   |~~~~~~~~~|   |~~~~~~~~~|   |~~~~~~~~~|   |~~~~~~~~~|
+---------+   +---------+   +---------+   +---------+   +---------+
     |             |             |             |             |
     V             V             V             V             V
  No room        No room      No room       No room     +----+
  for next       for next     for next      for next    |+--++----+
  shape          shape        shape         shape       ||--|~~~~~|
                                                        |+--+~~~~~|
                                                        +---------+

                                                           Done!

Lastly we print the combined shapes, without ~.
+----+
|+--++----+
||--|     |
|+--+     |
+---------+

+1 for being fast enough to be runnable. I think (disclaimer: I don't know Python) C>' ' can be replaced with C>32.

Great answer. Will accept it if there are no new answers for a while.

@user202729 Python's object comparison does allow for comparing strings with integers, though int("...")<"..." will always be true; Python's 'chars' are really strings of length one, which always come after an integer. One thing one could do to save a byte, though, would be to replace if C>' ' with if' '<C.

Wolfram Language (Mathematica), 811 bytes
(M=MorphologicalComponents;L=Length;A=Thread;T=Last;B=Table;P=Position;W=Prepend;g=AnyTrue[#,#!=" "&]&;h[n_]:=If[DuplicateFreeQ[Join@@B[(#-{1,1}+W[n,{1,1}][[i]]&)/@P[t[[i]],1],{i,L[y]}]],n,Nothing];R[z_]:=PadRight[#,Max[L/@z]," "]&/@z;s=Characters/@StringSplit[#,"\n"];s=R@s;r=Map[#/.{Longest[" "...],n___," "...}->{n}&,DeleteCases[A/@Split[A@s,g],_?(!g@#&),2],2];r[[1]]=R@#&@@r;t=r/.{"|"|"+"|"-"->1," "->0};y=M[#,Method->"ConvexHull"]&/@t;o=y-M/@t;u=T[h/@T@T@Reap[Outer@@Append[W[B[{NoneTrue[Flatten@B[#[[q+1,w+1]]==1&&o[[1]][[i+q,j+w]]==0,{w,0,L@#&@@#-1},{q,0,L@#-1}],TrueQ],i,j},{i,1,1+L@#&@@y-L@#},{j,1,1+L@y[[1,1]]-L@#&@@#}]&/@y[[2;;]],If[And@@(First/@{##}),Sow[#[[2;;]]&/@{##}]]&],2]]];If[u=={},"no",Grid@ReplacePart[r[[1]],Join@@B[(#-{1,1}+u[[i-1]])->Part[r[[i]],Sequence@@#]&/@P[t[[i]],1],{i,2,L@y}]]])&

It needs a frontend to display grid (which is not supported on tio.run).
The code does the following things:

Get inside points of 1st shape
Iterate over all starting point combinations
Pick a combination where all other (2, 3, ...) shapes' points lie in waht we get in Step 1, and without any overlapped points
Output (by ReplacePart)

If the input format can be more flexible, the code can be shortened to ~680 bytes. Besides that, there is still a lot of golfing space, though.
Try it online!
Expanded:
(M = MorphologicalComponents; L = Length; A = Thread; T = Last;
  B = Table; P = Position; W = Prepend; g = AnyTrue[#, # != " " &] &;
  h[n_] := If[
    DuplicateFreeQ[
     Join @@ B[(# - {1, 1} + W[n, {1, 1}][[i]] &) /@ P[t[[i]], 1], {i,
         L[y]}]], n, Nothing];
  R[z_] := PadRight[#, Max[L /@ z], " "] & /@ z;
  s = Characters /@ StringSplit[#, "\n"]; s = R@s;
  r = Map[# /. {Longest[" " ...], n___, " " ...} -> {n} &,
    DeleteCases[A /@ Split[A@s, g], _?(! g@# &), 2], 2];
  r[[1]] = R@# & @@ r; t = r /. {"|" | "+" | "-" -> 1, " " -> 0};
  y = M[#, Method -> "ConvexHull"] & /@ t; o = y - M /@ t;
  u = T[h /@
     T@T@Reap[
        Outer @@
         Append[W[
           B[{NoneTrue[
                Flatten@
                 B[#[[q + 1, w + 1]] == 1 &&
                   o[[1]][[i + q, j + w]] == 0, {w, 0,
                   L@# & @@ # - 1}, {q, 0, L@# - 1}], TrueQ], i,
               j}, {i, 1, 1 + L@# & @@ y - L@#}, {j, 1,
               1 + L@y[[1, 1]] - L@# & @@ #}] & /@ y[[2 ;;]],
           If[And @@ (First /@ {##}), Sow[#[[2 ;;]] & /@ {##}]] &],
          2]]]; If[u == {}, "no",
   Grid@ReplacePart[r[[1]],
     Join @@ B[(# - {1, 1} + u[[i - 1]]) ->
          Part[r[[i]], Sequence @@ #] & /@ P[t[[i]], 1], {i, 2,
        L@y}]]]) &


text:
In Soviet Russia, code writes you!
Input
Two words separated by a space. It is assumed that the first is a verb.
Output
The "Soviet counterpoint" to the input phrase, in the form of a punchline to an "in Soviet Russia" joke.
"break law" --> "In Soviet Russia, law break you!"

Accounting for correct grammar is unimportant.
Shortest program wins!

Just to clarify, we can't take 2 inputs, one of each word? i.e. bash russia.sh break law?

I've closed the challenge as a duplicate, because both challenges take two space-separated words and require them to be printed in reverse order with some fixed boilerplate string around/between them.

@MartinEnder: In this case the two words don't have anything between them in the output though, which allowed me to take a different approach in Perl 6.

@smls That's fair, you're free to cast a reopen vote.

Perl 6, 40 37 bytes

{"In Soviet Russia, {.words[1,0]} you!"}

{~[R,] «you! $_ Russia, Soviet In»}

It works because the « » "word list quote" recursively splits everything on whitespace.

Some other answers require the input words to be passed as two separate arguments. I think that's cheating, but for the record, it would make this solution 34 bytes long (and really boring):
{"In Soviet Russia, $^b $^a you!"}

Jelly, 20 bytes
“\UṙȦƒĊÑṆ»⁶³ḲṚK“æw}»

Try it online!
“\UṙȦƒĊÑṆ»⁶³ḲṚK“æw}»
“\UṙȦƒĊÑṆ»                   Set output to 'In Soviet Russia,'
          ⁶                  Set output to ' ' {implicitly printing the previous
                             output}
           ³                 Set output to the input {implicitly printing the
                             previous output}             "breaks law"
            Ḳ                Split {the input} on spaces. ['breaks', 'law']
             Ṛ               Reverse list.                ['law', 'breaks']
              K              Join with spaces.            "law breaks"
               “æw}»         Set output to ' you!' {implicitly printing the
                             previous output}

Alternatively, if there's no obligation for quotes around the input, it can be done in 19 bytes.
“\UṙȦƒĊÑṆ»⁶⁴⁶³“æw}»

Try it online!

This seems to be assuming that the user split the input into spaces themself? ⁴ doesn't work with the input format that the OP gave.

I kind of freestyled with two words, separated by a space. Added another version as well.

Huh, now our solutions are the same length but actually somewhat different in terms of algorithm. (We aren't even using quite the same string literals.) Weird to see that happen.

V, 29 bytes
iIn Soviet Russia, <C-r>b <C-r>a you!

Try it online!
Note that <C-r> is actually ctrl-r, or ASCII 0x12, but since that character is unprintable, using the verbose mode to represent it is more convenient.
This is probably about as short as it can get without using compression.

Python 3, 57 56 bytes
print("In Soviet Russia,",*input().split()[::-1],"you!")

Try it online

TI-Basic, 68 bytes
Input Str1
inString(Str1,"
"IN SOVIET RUSSIA, "+sub(Str1,Ans+1,Str1-Ans)+" "+sub(Str1,1,Ans-1)+" YOU!

"Accounting for correct grammar is unimportant." I guess that means I can yell everything ;)

Capitalization is not part of grammar. The OP said that so people didn't feel the need to add an 's' to the verb or add 'the' or something.

Gema, 32 characters
* *=In Soviet Russia, $2 * you\!

Sample run:
bash-4.3$ printf 'break law' | gema '* *=In Soviet Russia, $2 * you\!'
In Soviet Russia, law break you!

Jelly, 20 bytes
Ḳ“\UṙȦƒĊÑṆ»ṭṚ“©ṠẆ»ṭK

Try it online!
More fun with Jelly's compressed strings.
Ḳ“\UṙȦƒĊÑṆ»ṭṚ“©ṠẆ»ṭK
Ḳ                     Split {the input} on spaces
           ṭ          Add an additional input to the end:
 “\UṙȦƒĊÑṆ»             "In Soviet Russia," (compressed notation)
            Ṛ         Reverse the list
                  ṭ   Add another additional input to the end:
             “©ṠẆ»      "you!" (compressed notation)
                   K  Join on spaces {and implicitly output}

Retina, 39 37 bytes
Saved 2 bytes thanks to Martin Ender
(.+ )(.+)
In Soviet Russia, $2 $1you!

Try it online!

@MartinEnder Right, thanks. Not sure what I was thinking

Just for fun, if we assume there are no digits in the input, another byte can be saved by separating the swapping from adding the boilerplate: https://tio.run/nexus/retina#@@8fp5wQU67NpafN5ZmnEJxflplaohBUWlycmaijoKKmUJlfqvj/f1JRamK2Qk5iOQA

JAPT 29 Bytes
`In soviet rÔëa, {V} {U} y!`

input: "drink" "milk"
output: In Soviet Russia, milk drink you
explaination: {U} and {V} are the input variables.
it inserts them in the string when running the code.
First code-golf ever. hope it counts!
Try it online!

Welcome to PPCG, and thanks for using my language! Unfortunately, the input has to be given as a single string, but you can fix this by replacing {V} {U} with {¸w ¸} (¸ stands for qS, which splits a string on spaces and joins an array on spaces, and w reverses an array). Also, you can leave out the last backtick to save a byte. (Test these changes here)

05AB1E, 20 bytes
”InË·ž¦,”I#R„€î!)˜ðý

Try it online!

GNU sed, 40 bytes
s/(.+ )(.+)/In Soviet Russia, \2 \1you!/

Try it online!


text:
Windows Error Boxes to the next level
You know those Windows boxes where you can only do one thing?

Let's take this to the next level!
Challenge
Make a dialog box with a button that follows your cursor everywhere!
Specs
No input may be taken. There may be output to either STDOUT or STDERR. You must open a window with one button (no text is necessary, but text may be contained in either the window title, the dialog box, or the button). The button must be clickable, and it must always follow under your cursor so that you can only click it. Upon clicking, it can do anything you want, but please do not make it crash a computer because I will be testing this... The dialog box must stay open for as long as the button is not pressed, but it does not need to close when the button is closed.
Assumptions that you can make

You may assume that the cursor will stay within the drawing canvas.
You may assume that the window will stay in focus, but you must not put the window out of focus as long as the button is not pressed.

Example Pseudocode
Here's some example pseudocode:
Open Dialog Box
Add Button to Dialog Box at position X, Y
WHILE True:
    SET Dialog Box to CursorX - X, CursorY - Y

Test Cases cannot be provided for this challenge
This is a code-golf challenge, so the shortest valid submission by March 14th (Pi Day) wins!

If cursor follows me everywhere, I would escape by pressing the power button

@Wasif It's too late; the cursor has already escaped out of the virtual world. Watch out behind you.

MATLAB, 86 63 bytes
set(warndlg,'WindowButtonM',@(s,e)movegui(get(0,'Po')-[99,20]))

This solution takes advantage of MATLAB's (typically annoying) ability to use partial property names as long as the part that is provided is unique to only the property of interest.
This solution uses the builtin warndlg to create a warning dialog with an "OK" button. This function returns a figure handle which we can then use to set the WindowButtonMotionFcn callback (using the short name 'WindowButtonM').
The callback that is evaluated any time the cursor is moved within the window gets the current position of the cursor (using the PointerLocation property of the root graphics object, using it's short name 'Po'). We then update the Position of the figure using movegui and specifying the new location of the figure after applying an offset of [99, 20] so that the cursor is placed on the button.
When the button is finally clicked, the figure is deleted and all callbacks are automatically released.

A couple of issues on Windows R2014a. You can stop the dialog box from following by: 1. Moving your mouse (along with the dialog) box to the taskbar (my taskbar is on the right side of the screen) and the dialog box will stop following the mouse; 2. Moving your mouse fast enough such that the mouse is outside the dialog box at any frame, at which point the box will stop following the mouse. The style of the dialog box is also apparently dependent on something else... with the current code, my mouse barely misses the OK button, and I have to change 99 to 120 to work. Anyway, good work!

This is what I see from my perspective. My mouse is somewhere near that red crosshair.

C# (Windows Form Application), 200 114 bytes
void F(){var p=Cursor.Position;MouseMove+=(r,t)=>{Controls.Add(new Button());Location=new Point(p.X-30,p.Y-40);};}

Un-Golfed
void F()
{
     Controls.Add(new Button());

     MouseMove += (r, t) =>
     {
        var p = Cursor.Position;
        Location = new Point(p.X - 30, p.Y - 40);
     };
}

Old 200-byte solution:
public void F(){var t=this;var b=new Button();b.Click+=delegate{t.Close();};t.Controls.Add(b);t.Show();for(;;){Application.DoEvents();t.Location=new Point(Cursor.Position.X-30,Cursor.Position.Y-40);}}

Un-Golfed
    public void F()
    {
        var t = this;
        var b = new Button();

        b.Click += delegate
        {
            t.Close();
        };

        t.Controls.Add(b);
        t.Show();

        for (;;)
        {
            Application.DoEvents();
            t.Location = new Point(Cursor.Position.X - 30, Cursor.Position.Y - 40);
        }
    }

Wait.... so in C#, you can add an event listener by doing Event += listener? That's awesome :-)

@ETHproductions Could probably do that in C++ too if you overloaded the + operator. Still very succinct.

AutoHotkey, 122 115 bytes
MsgBox
WinWait,%A_ScriptName%
Loop{
MouseGetPos,x,y
WinGetPos,a,b
ControlGetPos,c,d,,,Button1
WinMove,x+a-c,y+b-d
}

Java 7, 294 289 286 264 220 bytes
import java.awt.*;public class B extends java.applet.Applet{Button b;public B(){add(b=new Button());}public void paint(Graphics g){Point p=MouseInfo.getPointerInfo().getLocation();b.setLocation(p.x-9,p.y-65);repaint();}}

-22 bytes thanks to MouseInfo (stolen from Zavada) I don't like the awt libraries >.>
I shaved off 44 bytes by removing the main method here. The main method isn't needed if this is launched as an applet. This can be achieved via eclipse's "Run As Java Applet" or by disabling the security manager and using appletviewer, which comes with the JDK (unless you're still able to view applets in web browsers. I don't think chrome allows this).

You can save 24 bytes by removing import java.awt.event.*;

@Zavada The * wildcard does not recursively import subpackages. I need java.awt.event for the MouseAdapter and MouseEvent

Apologies, I had a total brainfart!

Java, 172 199 235 Bytes
Golfed:
import java.awt.*;interface D{static void main(String[]z){new javax.swing.JDialog(){{setSize(9,99);setVisible(1>0);add(new Button());a();}void a(){for(Point p;;p=MouseInfo.getPointerInfo().getLocation(),setLocation(p.x-9,p.y-70));}};}}

Ungolfed:
import java.awt.*;
interface D{
    static void main(String[]z){
        new javax.swing.JDialog(){
            {
                setSize(9,99);
                setVisible(1>0);
                add(new Button());
                a();
            }
            void a(){

                for(;;) {
                    Point p = MouseInfo.getPointerInfo().getLocation();
                    setLocation(p.x-9,p.y-70);
                }
            }
        };

    }
}

Explanation: I use double brace initialization on my declaration of a new JDialog. This saved bytes by excluding the extension of JDialog (allowing me to save bytes excluding public from main). Inside JDialog's anonymous subclass I make it visible (using 1>0 instead of true) and call a(), which is necessary because the initalizer has a compile-time error if the loop were sat in it normally. I opted to use MouseInfo rather than all the excess code associated with adding a mouse listener.
Edit: Had to increase count by 27 to add add(new java.awt.Button());. I thought JDialogs had an implied button by technicality, but I seem to be wrong.
Edit 2: Had to add setSize and offset mouse location to make the button clickable.

I didn't know/remember MouseInfo was a thing. This is a neat answer.

@Poke Thanks. I saw your answer using applets, and I have an unreasonable hatred for applets, so I felt it would be cute to do in swing. Your answer is nice though :)

Modified Processing Js 102 108 bytes
draw=function(){background(0);rect(mouseX,mouseY,9,9);rect(mouseX,mouseY,4,4);if(mouseIsPressed){fill(9);}};

Try it online! Just updated my link!
It just draws a rectangle that follows your mouse and a smaller rectangle inside of it that you click and it turns red. It works but is not amazing. This version if very strict on braces and all of that :(

You can remove the braces around fill

@KritixiLithos I actually can't :(

It is a strictly type language version

You could use another type of Processing to save bytes then

@KritixiLithos actually then I would also have to set up a screen size and that would add bytes. (Side note I just got kicked from chat for "inappropriate content any idea why? It was a bot too. https://chat.stackexchange.com/messages/35631789/history was why

First of all, you need to clear the background at the beginning of the draw. Also, you can do fill(-65536); for the fill statement instead

Mathematica 226 Bytes
The mouse position relative to the screen is tracked by the front end and the window position of the dialog notebook is moved whenever the mouse moves.  Pretty simple, but the commands are very lengthy in terms of letters, as often the case with Mathematica.  Clicking OK will close the dialog.
{s,d,w}={SetOptions,Dynamic,WindowMargins->m};With[{p=d@MousePosition["ScreenAbsolute"]},
m=d@{{p[[1]]-50,0},{0,p[[2]]-35}}];s[$FrontEndSession,FrontEndEventActions->{"MouseMoved":>s[a,w]}];a=CreateDialog[{DefaultButton[]},w];

P.S. When you're done testing, run this to remove the front end option.
SetOptions[$FrontEndSession,FrontEndEventActions->None]

Javascript (ES6) + HTML + CSS, 139 bytes
HTML:
<d id=d><button>X

CSS:
d{background:red;padding:9px;position:absolute

Javascript:
onmousemove=e=>{with(d.style){top=e.clientY-20+'px';left=e.clientX-20+'px'}}

Since you can't position alert dialogs, I made my custom super fancy dialog in HTML. The javascript registers an event handler on the window object and sets the position to the coordinates of the event.
Try it online: https://jsfiddle.net/1yohswje/

Clojure, 525 bytes
(ns d(:require[quil.core :as q][quil.middleware :as m]))(def w 500)(def h 200)(def t 30)(def n 200)(def m 100)(q/defsketch d :size[999 999]:setup(fn[](q/stroke 0 0 0)(q/text-font(q/create-font""(* t 1.3))){:x 0 :y 0}):draw(fn[{x :x y :y}](let[r q/rect f q/fill o(- x(/ w 2))p(- y (/ h 2))](q/background 99 99 99)(f 0 0 255)(r o p w h)(f 200 200 200)(r o(+ p t)w(- h t))(f 255 0 0)(r(-(+ o w)t)p t t)(f 255 255 255)(q/text"X"(- (+ o w) t)(+ p t))(r(- x(/ n 2))(- y (/ m 2))n m))):mouse-moved(fn[_ e]e):middleware[m/fun-mode])

Does not create a genuine Windows dialog. Instead, it builds a fake one, and creates a dummy (non-functioning) button in the middle.
This was allowed by the OP in the comments.
Uses the Quil library.
(ns bits.golf.following-dialog
  (:require [quil.core :as q]
            [quil.middleware :as m]))

(def width 500)
(def height 200)

(def top-bar-height 30)

(def b-width 200)
(def b-height 100)

(defn -main []
  (q/defsketch d
    :size [999 999]
    :setup (fn []
             ; Set the border color
             (q/stroke 0 0 0)

             ; Set the font size
             (q/text-font (q/create-font "" (* top-bar-height 1.3)))

             ; The initial state
             {:x 0 :y 0})

    :draw (fn [{x :x y :y}]
            (let [r q/rect ; Shortcut functions for brevity
                  f q/fill

                  ; The top-left coordinates of the window
                  window-x  (- x (/ width 2))
                  window-y (- y (/ height 2))]

              ; Wipe the previous screen
              (q/background 99 99 99)

              ; Blue top bar
              (f 0 0 255)
              (r window-x
                 window-y
                 width height)

              ; Grey window background
              (f 200 200 200)
              (r window-x
                 (+ window-y top-bar-height)
                 width (- height top-bar-height))

              ; Red top right "button"
              (f 255 0 0)
              (r (- (+ window-x width)
                    top-bar-height)
                 window-y
                 top-bar-height top-bar-height)

              ; The X
              (f 255 255 255)
              (q/text "X" (- (+ window-x width) top-bar-height)
                          (+ window-y top-bar-height))

              ; The main "button"
              (r (- x (/ b-width 2))
                 (- y (/ b-height 2))
                 b-width
                 b-height)))

    ; When the mouse is moved, set the current state to the event object, which
    ;  conveniently has :x and :y properties
    :mouse-moved (fn [_ e] e)

    ; Needed for ease of state management. May try to factor out.
    :middleware [m/fun-mode]))

Pug/Slim + CSS/SCSS/LESS/Stylus + ES6 Javascript (98 Bytes)
Try it online!
Pug (10 UTF-8 Bytes)
button#a X

Stylus (18 UTF-8 Bytes)
#a{position:fixed}

JS (70 UTF-8 Bytes)
onmousemove=e=>{with(a.style){top=e.clientY+'px';left=e.clientX+'px'}}

Decompiled, Ungolfed and explained Snippet:

document.addEventListener('mousemove', function(e) {
  // Get element with an id of "id"
  var el = document.getElementById("id");
  // Set the vertical position
  el.style.top = e.clientY + 'px';
  // Set the horizontal position
  el.style.left = e.clientX + 'px';
})
/* Get element with an id of "id" */

#id {
  /* Position it relative to the viewport*/
  position: fixed;
}
<!-- A basic HTML button with an ID of "id" -->
<button id='id'>
  X
</button>


text:
Lily pad jumping
In this challenge, you need to simulate a frog jumping back and forth on lily pads.  The pond is infinitely big, has a line of an infinite number of lily pads, and the frog can jump across as many lily pads as he likes.
This frog likes to jump back and forth:  after jumping forward, he always jumps backwards, and vice versa.
You are passed a list of integers, which represents his jumps.  You need to output the result of his jumps.
For example, say you are passed [2,3,6,8,2]:
Our frog starts by jumping 2 lily pads forward:
_2

Then 3 lily pads back:
3__2

Then 6 lily pads forward:
3__2__6

8 back:
8_3__2__6

Then finally, 2 lily pads forward (notice how the 2 overwrites the 3):
8_2__2__6

To be more explicit: Your input is an an array of numbers S, you need to output S[K] at the position S[K] - S[K-1] + S[K-2] - S[K-3]....

If multiple numbers are to be printed at a certain location, print only the one with the highest index.
You are to use _ if a particular location is empty
If a number has multiple digits, it does not take up multiple locations. (In other words, a location can consist of multiple characters)
You can assume that your list is non-empty, and that all integers are greater than 0.

Test cases:
5                   ____5
2,2                 2_2
4,3,2,1             3124
5,3,2,1             _3125
2,3,6,8,2           8_2__2__6
10,3,12,4,1,12,16   ___12__3__10____41__1216
100,4,7,2,2         _______________________________________________________________________________________________4___1002_2

This is a code-golf, so answer it in as few characters as possible!

I wonder who watched Numberphile?

So there's gonna be a challenge for every Numberphile video then...

Related :-P

@Fatalize I see nothing wrong with that.

Also related ;-)

print only the one with the highest index You mean its index in the input array?

@smls correct.  I wasn't sure of a clearer way to say that, so if you have any suggestions, I'm all ears :)

@nderscore sorry, the __2 was wrong.  Thank you!

How large is the frog pond? Is there a minimum range size that we are required to support?

A single jump will never be bigger than your language's maximum integer.  However, there is no maximum on the pond size (outside of memory constraints)

MATL, 35 34 bytes
Thanks to @Emigna for saving 1 byte!
32Oittn:oEq*Yst1hX<-Q(Vh' 0'95ZtXz

Try it online! Or verify all test cases.
How it works
Golf your code, not your explanations!
The following uses input [2,3,6,8,2] as an example. To see intermediate results in the actual code, you may want to insert a % (comment symbol) to stop the program at that point and see the stack contents. For example, this shows the stack after statement Ys (cumulative sum).
32       % Push 32 (ASCII for space)
O        % Push 0
i        % Input array
         % STACK: 32, 0, [2,3,6,8,2]
t        % Duplicate
         % STACK: 32, 0, [2,3,6,8,2], [2,3,6,8,2]
tn:      % Push [1 2 ... n] where n is length of input array
         % STACK: 32, 0, [2,3,6,8,2], [2,3,6,8,2], [1,2,3,4,5]
o        % Modulo 2
         % STACK: 32, 0, [2,3,6,8,2], [2,3,6,8,2], [1,0,1,0,1]
Eq       % Multiply by 2, subtract 1
         % STACK: 32, 0, [2,3,6,8,2], [2,3,6,8,2], [1,-1,1,-1,1]
*        % Multiply elementwise
         % STACK: 32, 0, [2,3,6,8,2], [2,-3,6,-8,2]
Ys       % Cumulative sum
         % STACK: 32, 0, [2,3,6,8,2], [2,-1,5,-3,1]
         % The top-most array is the positions where the entries of the second-top
         % array will be written. But postions cannot be less than 1; if that's
         % the case we need to correct so that the minimum is 1. If this happens,
         % it means that the frog has gone further left than where he started
t        % Duplicate
1hX<     % Append 1 and compute minimum. So if the original minimum is less than 1
         % this gives that minimum, and if it is more than 1 it gives 1
         % STACK: 32, 0, [2,3,6,8,2], [2,-1,5,-3,1], -3
-        % Subtract
         % STACK: 32, 0, [2,3,6,8,2], [5 2 8 0 2]
Q        % Add 1
         % STACK: 32, 0, [2,3,6,8,2], [6 3 9 1 3]
(        % Assign values (top array) to specified positions (second-top) into array
         % which contains a single 0 (third-top). Newer values overwrite earlier
         % values at the same position
         % STACK: 32, [8 0 2 0 0 2 0 0 6]
V        % Convert to string. This produces spaces between the numbers
         % STACK: 32, '8 0 2 0 0 2 0 0 6'
h        % Concatenate with initial 32 (space). This converts to char
         % STACK: ' 8 0 2 0 0 2 0 0 6'
         % Thanks to this initial space, all zeros that need to be replaced by '_'
         % are preceded by spaces. (In this example that initial space would not
         % be needed, but in other cases it will.) Other zeros, which are part of
         % a number like '10', must not be replaced
' 0'     % Push this string: source for string replacement
         % STACK: ' 8 0 2 0 0 2 0 0 6', ' 0 '
95       % Push 95 (ASCII for '_'): target for string replacement
         % STACK: ' 8 0 2 0 0 2 0 0 6', ' 0 ', 95
Zt       % String replacement
         % STACK: ' 8_2__2__6'
Xz       % Remove spaces. Implicit display
         % STACK: '8_2__2__6'

I think you could save two bytes by replacing '0' instead of ' 0 ', because Xz removes the spaces after

@B.Mehta Thanks. I initially did that, but unfortunately it doesn't work, because then the '0' in '10' gets replaced too. That's why I add an initial 32 too

Ah of course, my mistake

@B.Mehta No, it wasn't clear at all from my explanation. I'll clarify that later

The mod 2 array is inverted in the explanation. And also, wouldn't ' 0' work just as well?

@Emigna Thanks; and yes, extra thanks!

R, 100 97 96 bytes
function(x){p=cumsum(x*c(1,-1))[seq(x^0)]
p=p+max(1-p,0)
v=rep('_',max(p));v[p]=x
cat(v,sep='')}

Try it online!
Line 1 finds all positions where to jump. First, all jumps in x are multiplied by 1 or −1 and then transformed to final positions using cumulative summation. The vector c(-1,1) is recycled if necessary, however, when x is of length 1, x is recycled instead. Therefore only seq(x^0) (equivalent to seq_along(x)) sums are considered. (A warning is generated when the length of x is not a multiple of 2 but it does not affect the result)
Line 2 increases the jumping positions so that all are at least 1.
Lines 3 and 4 create the output and print it.
−1 byte from Giuseppe

neat trick with seq(x^0)!

-p+1 can be 1-p for one byte less.

@Giuseppe Ah, definitely, thanks!

PHP, 100 101 99 104 bytes
for($p=-1;$d=$argv[++$k];+$i<$p?:$i=$p,$x>$p?:$x=$p)$r[$p+=$k&1?$d:-$d]=$d;for(;$i<=$x;)echo$r[$i++]?:_;

takes input from command line arguments; run with -nr.
breakdown
for($p=-1;          // init position
    $d=$argv[++$k]; // loop $d through command line arguments
    +$i<$p?:$i=$p,          // 3. $i=minimum index
    $x>$p?:$x=$p            // 4. $x=maximum index
)
    $r[
        $p+=$k&1?$d:-$d     // 1. jump: up for odd indexes, down else
    ]=$d;                   // 2. set result at that position to $d
for(;$i<=$x;)           // loop $i to $x inclusive
    echo$r[$i++]?:_;        // print result at that index, underscore if empty

How does this handle the example input 2,3,6,8,2, where the 8 jumps "backwards" past the "beginning" of the lily pads?

@AdmBorkBork PHP supports negative array indexes.

Ah, did not know that. Thanks!

JavaScript (ES6), 99 107 bytes
Edit: Because the OP clarified that the only limit should be the available memory, this was updated to allocate exactly the required space instead of relying on a hardcoded maximum range.
f=(a,x='',p=M=0)=>a.map(n=>x[(p-=(i=-i)*n)<m?m=p:p>M?M=p:p]=n,i=m=1)&&x?x.join``:f(a,Array(M-m).fill`_`,-m)

How it works
This function works in two passes:

During the first pass:

The 'frog pointer' p is initialized to 0.
The x variable is set to an empty string, so that all attempts to modify it are simply ignored.
We compute m and M which are respectively the minimum and maximum values reached by p.
At the end of this pass: we do a recursive call to f().

During the second pass:

p is initialized to -m.
x is set to an array of size M-m, filled with _ characters.
We insert the numbers at the correct positions in x.
At the end of this pass: we return a joined version of x, which is the final result.

Test cases

f=(a,x='',p=M=0)=>a.map(n=>x[(p-=(i=-i)*n)<m?m=p:p>M?M=p:p]=n,i=m=1)&&x?x.join``:f(a,Array(M-m).fill`_`,-m)

console.log(f([5]));                  // ____5
console.log(f([4,3,2,1]));            // 3124
console.log(f([5,3,2,1]));            // _3125
console.log(f([2,3,6,8,2]));          // 8_2__2__6
console.log(f([10,3,12,4,1,12,16]));  // ___12__3__10____41__1216
console.log(f([100,4,7,2,2]));        // _..._4___1002_2

This fails for cases where the frog jumps below index -998 or above 1002. Example: [1100] results in the number printed at position 1002 instead of position 1100.

@nderscore This is fixed, at the cost of 8 bytes.

awesome! nice method also :)

Jelly,  28  24 bytes
-2 (and further allowing another -2) thanks to FrownyFrog (use the [post-challenge] functionality of the prefix application quick, Ƥ)
ṚƤḅ-µCṀ»0+µṬ€×"³Ṛo/o”_;⁷

Try it online! Full program, for a test suite using the same functionality, click here.
How?
ṚƤḅ-µCṀ»0+µṬ€×"³Ṛo/o”_;⁷ - Main link: list a       e.g. [ 5, 3, 2, 1]
 Ƥ                       - prefix application of:
Ṛ                        -  reverse                e.g. [[5],[3,5],[2,3,5],[1,2,3,5]]
   -                     - literal minus one
  ḅ                      - from base (vectorises)  e.g. [ 5, 2, 4, 3]=
    µ                    - start a new monadic chain - call that list c
                         - [code to shift so minimum is 1 or current minimum]
     C                   - complement (vectorises) e.g. [-4,-1,-3,-2]
      Ṁ                  - maximum                 e.g.     -1
       »0                - maximum of that & zero  e.g.      0
         +               - add to c (vectorises)   e.g. [ 5, 2, 4, 3]
          µ              - start a new monadic chain - call that list d
           Ṭ€            - untruth €ach            e.g. [[0,0,0,0,1],[0,1],[0,0,0,1],[0,0,1]]
               ³         - the program input (a)
             ×"          - zip with multiplication e.g. [[0,0,0,0,5],[0,3],[0,0,0,2],[0,0,1]]
                Ṛ        - reverse                      [[0,0,1],[0,0,0,2],[0,3],[0,0,0,0,5]]
                 o/      - reduce with or          e.g. [0,3,1,2,5]
                    ”_   - '_'
                   o     - or (replace 0 with '_') e.g. ['_',3,1,2,5]
                      ;⁷ - concatenate a newline   e.g. ['_',3,1,2,5, '\n']
                         - implicit print

Notes:
The final concatenation of a newline, ;⁷ is for cases when no _ appear in the output, in which case the implicit print would display a representation of the list, e.g. [3, 1, 2, 4], rather than something like the example, _3125. For no trailing newline one could replace ;⁷ with ;““ to append a list of character lists, [[''],['']] (no close ” required as it's the last character of a program).
The untruth function, Ṭ, gives a list with 1s at the indexes in it's input, for a single natural number, n that is n-1 0s followed by a 1 allowing the input numbers to be placed at their correct distance from the left by multiplication. The reversal, Ṛ, is required to have later frog-visits overwrite rather than earlier ones when the reduction with or, o/, is performed.

1,-ṁ×µ+\→UƤ_@/€ ?

Ƥ was not a feature at the point this was written, but yes that will work. Better is UƤḅ€- (since conversion from base -1 is like multiplying by ...,1,-1,1,-1,1,-1,1 and then summing).

...or even UƤḅ- since ḅ vectorises :) (I also went with plain reverse, Ṛ, since we don't need the complexity of upend, U)

Perl 6, 68 67 bytes
{(my @a)[[[\+] |(1,-1)xx*Z*$_].&{$_ X-min 1,|$_}]=$_;[~] @a X//"_"}

Try it online!
How it works
First it determines the cumulative jump locations:
[[\+] |(1,-1)xx*Z*$_]
                  $_  # Input array.          e.g.  2, 3, 6, 8, 2
      |(1,-1)xx*      # Infinite sequence:          1,-1, 1,-1, 1...
                Z*    # Zip-multiplied.       e.g.  2,-3, 6,-8, 2
 [\+]                 # Cumulative addition.  e.g.  2,-1, 5,-3,-1

Then it turns them into 0-based array indices by subtracting the minimum number (but at most 1) from all the numbers:
.&{$_ X-min 1,|$_}    #                       e.g.  5, 2, 8, 0, 2

Then it creates an array with the input numbers assigned to those indices:
(my @a)[   ]=$_;      #                       e.g.  8, Nil, 2, Nil, Nil, 2 Nil, Nil, 6

Finally it concatenates the array to a string, with the underscore in place of undefined elements:
[~] @a X//"_"         #                       e.g.  8_2__2__6

Javascript (ES6), 109 bytes

f=x=>x.map((y,i)=>o[j=(j-=i%2?y:-y)<0?o.unshift(...Array(-j))&0:j]=y,o=[],j=-1)&&[...o].map(y=>y||'_').join``
<!-- snippet demo: -->
<input list=l oninput=console.log(f(this.value.split(/,/)))>
<datalist id=l><option value=5><option value="4,3,2,1"><option value="5,3,2,1"><option value="2,3,6,8,2"><option value="10,3,12,4,1,12,16"><option value="100,4,7,2,2"></datalist>

Commented:
f=x=>x.map((y,i)=>o[j=(j-=i%2?y:-y)<0?o.unshift(...Array(-j))&0:j]=y,o=[],j=-1)&&[...o].map(y=>y||'_').join``
                /* initialize output array [] and index j at -1: */  o=[],j=-1
     x.map((y,i)=> /* iterate over all items in input x (y=item, i=index) */  )
                      (j-=i%2?y:-y) /* update j +/-y based on if index i is odd */
                                   <0? /* if resulting j index is less than zero */
                                      o.unshift(...Array(-j)) /* prepend -j extra slots to the output array */
                                                             &0 /* and give result 0 */
                                                               :j /* else give result j */
                    j= /* assign result to j */
                  o[ /* assign y to output array at index j */   ]=y
   /* short-circuit && then spread output array to fill any missing entries */ &&[...o]
                                                      /* fill falsey slots with '_' */ .map(y=>y||'_')
                                                                         /* join with empty spaces */ .join``

APL (Dyalog Unicode), 45 30 bytesSBCS
{∊⍕¨⍵@i⍴∘'_'⌈/1+i←(⊢-1⌊⌊/)-\⍵}

Try it online!
-\⍵ scan the argument with alternating - and +
(⊢ - 1 ⌊ ⌊/) from that (⊢) subtract 1 or the minimum (⌊/), whichever is smaller (⌊)
i← assign to i
⌈/ 1+ increment and take the maximum
⍴∘'_' produce that many underscores
⍵@i put the numbers from the argument (⍵) at positions i
∊⍕¨ format each and flatten

Python 2, 113 110 bytes
J=input()
i=sum(J)
l=['_']*2*i
v=i,
d=1
for j in J:i+=d*j;d=-d;l[i]=`j`;v+=i,
print''.join(l[min(v):max(v)+1])

Try it online!

Ruby, 85 bytes
->a{i=1;j=c=0;a.map{|x|[c-=x*i=-i,x]}.to_h.sort.map{|x,y|[?_*[x+~j,0*j=x].max,y]}*''}

Try it online!
Records the positions after each jump, converts the resulting array to hash to remove duplicates (preserving the last value at each duplicated position), and then glues the values with the required amount of underscores.

05AB1E, 36 bytes
Z·'_иsvy®yNÈi+ë-}©ǝ®0‹i¤®Äиy0©ǝì]¤ÜJ

Try it online or verify all test cases.
Explanation:
Z               # Get the maximum of the (implicit) input-list (without popping)
 ·              # Double it
  '_и          '# Pop and push a list with 2*max amount of "_"
s               # Swap so the input-list is at the top
 v              # Loop over each of its integers `y`:
  y             #  Push the current integer `y`
  ®             #  Push integer `®` (-1 the first iteration)
   y            #  Push integer `y` again
    N           #  Push the 0-based loop-index
     Èi         #  If the index is even:
       +        #   Add the `y` to `®`
      ë         #  Else (the index is odd):
       -        #   Subtract the `y` from `®` instead
      }         #  Close the if-else clause
       ©        #  Store it as new `®` (without popping)
  ǝ             #  Insert the `y` at this index `®` in the "_"-list
                #  (no-op with pops if index `®` is out of bounds, e.g. negative)
  ®0‹i          #  If `®` is negative (<0):
      ¤         #   Push the last item "_" (without popping the list)
       ®Ä       #   Push the absolute value of `®`
         и      #   Pop both and push a list with that amount of "_"
          y     #   Push integer `y` again
           0    #   Push 0
            ©   #   Replace `®` with this 0 (without popping)
             ǝ  #   Insert the `y` at index 0 in the second "_"-list
              ì #   Prepend the two lists together
 ]              # Close both the if-statement and loop
  ¤             # Push the last item "_" again (without popping the list)
   Ü            # Trim all trailing "_" from the list
    J           # Join the list together
                # (after which the result is output implicitly)

NÈi+ë-} could alternatively be „+-Nè.V for the same byte-count: Try it online or verify all test cases.
    „+-         #  Push string "+-"
       Nè       #  (Modulair) index the loop-index into it
         .V     #  Evaluate and execute this character as 05AB1E code