Jelly,  21  20 bytes
Probably beatable by a number of bytes using some clever mathematics...
:g/
ÇµSRRUĖ€UÐeẎÇ€Qi

A monadic link accepting a list of [p,q] which returns the natural number assigned to p/q.
Try it online! Or see the test-suite.
How?
First note that the Nth diagonal encountered contains all of the grid's rational numbers for which the sum of the numerator and denominator equals N+1, so given a function which reduces a [p,q] pair to simplest form ([p/gcd(p,q),q/gcd(p,q)]) we can build the diagonals as far as need be*, reduce all the entries, de-duplicate and find the index of the simplified input.
* actually one further here to save a byte
:g/ - Link 1, simplify a pair: list of integers, [a, b]
  / - reduce using:
 g  - Greatest Common Divisor -> gcd(a, b)
:   - integer division (vectorises) -> [a/gcd(a,b), b/gcd(a,b)]

ÇµSRRUĖ€UÐeẎÇ€Qi - Main Link: list of integers, [p, q]
Ç                - call last Link as a monad (simplify)
 µ               - start a new monadic chain (call that V)
  S              - sum -> the diagonal V will be in plus one
   R             - range -> [1,2,3,...,diag(V)+1]
    R            - range (vectorises) -> [[1],[1,2],[1,2,3],...,[1,2,3,...,diag(V)+1]]
     U           - reverse each       -> [[1],[2,1],[3,2,1],[diag(V)+1,...,3,2,1]]
      Ė€         - enumerate €ach     -> [[[1,1]],[[1,2],[2,1]],[[1,3],[2,2],[3,1]],[[1,diag(V)+1],...,[diag(V)-1,3],[diag(V),2],[diag(V)+1,1]]]
         Ðe      - apply only to the even indexed items:
        U        -   reverse each     -> [[[1,1]],[[2,1],[1,2]],[[1,3],[2,2],[3,1]],[[4,1],[3,2],[2,3],[1,4]],...]
           Ẏ     - tighten            -> [[1,1],[2,1],[1,2],[1,3],[2,2],[3,1],[4,1],[3,2],[2,3],[1,4],...]
            Ç€   - for €ach: call last Link as a monad (simplify each)
                 -                    -> [[1,1],[2,1],[1,2],[1,3],[1,1],[3,1],[4,1],[3,2],[2,3],[1,4],...]
              Q  - de-duplicate       -> [[1,1],[2,1],[1,2],[1,3],[3,1],[4,1],[3,2],[2,3],[1,4],...]
               i - index of V in that list


Cops and Robbers bowling (Robbers) Robbers' Thread
In this challenge, your goal is to crack some code written by the Cops (their code is here) by modifying it.  You have cracked their code if:

Your modified code has a maximum levenshtein-distance of 10 from theirs, and has fewer characters
The function, given the same valid input, will produce the same output in the same language of the same version
You posted your modified version within 168 hours (1 week) of the original post.

Your modified code must only have printable ASCII.
After posting a cracked version, you should leave a comment in the original code saying that it has been cracked with a link to your crack.
Your score is the total Levenshtien distance among all of your answers.   Highest score wins.
The accompanying Cops' thread can be found here.

Original by bitpwner, Python, 5199

lambda x:eval(eval("'[encoded data, 5136 characters]'"+".decode('base64').decode('zlib')"*56))

Modified Version Python, 5198 Levenshtein Distance 2:

lambda x:eval(eval("'[encoded data, 5136 characters]'"+".decode('base64').decode('zip')"*56))

Replaced 'zlib' with shorter alias 'zip'.


Find the area of a polygon Given consecutive side lengths s1, s2, s3... s_n of an n-gon inscribed in a circle, find its area. You may assume that the polygon exists. In addition, the polygon will be convex and not self-intersecting, which is enough to guarantee uniqueness. Built-ins that specifically solve this challenge, as well as built-in functions that calculate the circumradius or circumcenter, are banned (this is different from a previous version of this challenge).

Input: The side lengths of the cyclic polygon; may be taken as parameters to a function, stdin, etc.

Output: The area of the polygon.

The answer should be accurate to 6 decimal places and must run within 20 seconds on a reasonable laptop.

This is code golf so shortest code wins!

Specific test cases:

[3, 4, 5] --> 6
[3, 4, 6] --> 5.332682251925386
[3, 4, 6, 7] --> 22.44994432064365
[5, 5, 5, 5] --> 25
[6, 6, 6, 6, 6] --> 61.93718642120281
[6.974973020933265, 2.2393294197257387, 5.158285083300981, 1.4845682771595603, 3.5957940796134173] --> 21.958390804292847
[7.353566082457831, 12.271766915518073, 8.453884922273897, 9.879017670784675, 9.493366404245332, 1.2050010402321778] --> 162.27641678140589

Test case generator:

function randPolygon(n) {
  var left = 2 * Math.PI;
  var angles = [];
  for (var i = 0; i < n - 1; ++i) {
    var r = Math.random() * left;
    angles.push(r);
    left -= r;
  }
  angles.push(left);
  var area = 0;
  var radius = 1 + Math.random() * 9;
  for (var i = 0; i < angles.length; ++i) area += radius * radius * Math.sin(angles[i]) / 2;
  var sideLens = angles.map(function(a) {
    return Math.sin(a / 2) * radius * 2;
  });

  document.querySelector("#radius").innerHTML = radius;
  document.querySelector("#angles").innerHTML = "[" + angles.join(", ") + "]";
  document.querySelector("#inp").innerHTML = "[" + sideLens.join(", ") + "]";
  document.querySelector("#out").innerHTML = area;

  draw(angles);
}

function draw(angles) {
  var canv = document.querySelector("#diagram"),
    ctx = canv.getContext("2d");
  var size = canv.width
  ctx.clearRect(0, 0, size, size);
  ctx.beginPath();
  ctx.arc(size / 2, size / 2, size / 2, 0, 2 * Math.PI, true);
  ctx.stroke();
  ctx.beginPath();
  ctx.moveTo(size, size / 2);
  var runningTotal = 0;
  for (var i = 0; i < angles.length; ++i) {
    runningTotal += angles[i];
    var x = Math.cos(runningTotal) * size / 2 + size / 2;
    var y = Math.sin(runningTotal) * size / 2 + size / 2;
    ctx.lineTo(x, y);
  }
  ctx.stroke();
}
document.querySelector("#gen").onclick = function() {
  randPolygon(parseInt(document.querySelector("#sideLens").value, 10));
}

These are to help you; they are not part of the input or output.

  Circumradius:

  Angles, in radians, of each sector (this are NOT the angles of the polygon):

  Input:

  Output:

  Diagram:

  <canvas id="diagram" width="200" height="200" style="border:1px solid black"></canvas>

Number of side lengths:
<input type="number" id="sideLens" step="1" min="3" value="3" />

<button id="gen">Generate test case</button>

Python 2, 191 bytes

from math import*
C=sorted(input());l,h=C[-1]/2,sum(C)
while h-l>1e-9:m=l+h;a=[asin(c/m)for c in C[:-1]];f=pi-sum(a);l,h=[l,m/2,h][m*sin(f)<C[-1]:][:2]
print sum(l*l*sin(2*t)for t in a+[f])/2

Uses a binary search to find the radius, then calculates the area of each segment by the angle/radius.

It finds the radius by first summing all but the largest chord angle, and checking the remaining angle to the remaining chord. Those angles are then also used to compute the area of each segment. A segment's area can be negative, if it's angle is bigger than 180 degrees.

Readable implementation:

import math

def segment_angles(line_segments, r):
    return [2*math.asin(c/(2*r)) for c in line_segments]

def cyclic_ngon_area(line_segments):
    line_segments = list(sorted(line_segments))
    lo, hi = max(line_segments) / 2, sum(line_segments)
    while hi - lo > 1e-9:
        mid = (lo + hi) / 2
        angles = segment_angles(line_segments[:-1], mid)
        angles.append(2*math.pi - sum(angles))
        if 2 * mid * math.sin(angles[-1]/2) < line_segments[-1]:
            lo = mid
        else:
            hi = mid
    return sum([lo*lo * math.sin(a) / 2 for a in angles])


Finding maximum paths Given a square of positive, natural numbers write a program find a horizontal and a vertical path with the sum of numbers along them being maximal. A horizontal path goes from the first column to the last and has to increase its column position by one in each step. A vertical path goes from the first row to the last and has to increase its row position by one in each step. Furthermore the row position in a horizontal path may stay the same or change by one in either direction, likewise for vertical paths.

To illustrate, the following could be a valid path:

The following path would be invalid, since it steps backwards (and remains on the same row in some places):

The following path would be equally invalid, since it changes the row position by more than one in a single step:

Note: The solution should run in an acceptable amount of time.

Input

n lines of input with n space-separated positive integers each are given on standard input. 2 ≤ n ≤ 40. Every line is terminated by a line break. The numbers are small enough that the maximum sum fits in a 32-bit signed integer.

Output

The maximum sums of the horizontal and vertical paths (in that order) separated by a single space.

Sample input 1

1 2
1 2

Sample output 1

3 4

Sample input 2

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
2 1 4 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 4 1 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 4 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 5 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

Sample output 2

37 35

Sample input 3

683 671 420 311 800 936
815 816 123 142 19 831
715 588 622 491 95 166
885 126 262 900 393 898
701 618 956 865 199 537
226 116 313 822 661 214

Sample output 3

4650 4799

For your convenience we have prepared a few test cases in bash (thanks to Ventero) and PowerShell which you can run your program through. Invocation is: <test> <command line>, so something like ./test python paths.py or ./test.ps1 paths.exe. Have fun :-)

GolfScript - 49 Nabb enhanced characters
51 characters
50 strictly and utterly necessary characters + 3 slackers that only did the job of 1
56 mostly redundant characters
n%{~]}%.zip{{0@+\{\.1>\3<$-1=@+}%\;}*$-1=\}2*' '@

51 solution:
n%{~]}%.zip{(\{0@+\{\.1>\3<$-1=@+}%\}%;$-1=\}2*' '@

53 solution:
n/{~]}%);.zip{(\{0@+\{\.1>\3<$-1=@+}%\}%;$-1=\}2*' '@
             a8_b9___c10___11______12 13      14_

The method works on two lines at a time, one containing the maximum sums reached at each point, and one containing the next line.
a/14: Repeat twice, once for each result.
8: Take the first line from the input and switch it behind the input array, this in now the first set of maximum sums.
b/13: Iterate over each remaining line in the array.
9: Put 0 at the beginning of the maximum sums.
c/12: Iterate over each element of the line.
10: Make a copy of the maximum sums with the first element removed.
11: Take the first 3 elements of the maximum sums, sort them and add the largest to the current element of the line.
56 solution:
n/{~]}%);.zip{1,99*\{{\.1>\3<$-1=@+}%0\+\}%;$-1=\}2*' '@
1________2___ 3____ 4______________________5_____ 6_7___

1: From input to array of arrays in 9 characters, actually it could have been done with just 1, but I broke that key so this will have to do.
2: 4 characters just to make a transposed copy.
3: Array of 99 0s in 5 characters, it could probably be done in a way smarter fashion, but I smoke too much weed to figure how.
4: Overly complicated double loop that iterate over every single element of the input and does some fuzzy logic or something like that to produce the result. Nabb will probably make something equivalent in around 3½ characters.
5: By now the result is there, inside an array that is, this silly piece of code is just there to get it out (and junk a piece of leftovers (and switch the result into place)).
6: This is a command so simple that its character count would probably be negative in an optimal solution.
7: At this point the program is really done, but due to sloppiness in the preceding code the output is in the wrong order and lacks a space, so here goes a few more bits down the drain.


The Kimberling Sequence Introduction
Of course, we've got a lot of sequence challenges, so here is another one.
The Kimberling sequence (A007063) goes as following:
1, 3, 5, 4, 10, 7, 15, 8, 20, 9, 18, 24, 31, 14, 28, 22, ...

This is produced by shuffling the normal iteration:
[1] 2  3  4  5  6  7  8

The first term of the sequence is 1. After that, we reshuffle the sequence until all the terms on the left are used. The shuffling has the pattern right - left - right - left - .... Since there are no terms at the left of the 1, there is no shuffling. We get the following:
 2 [3] 4  5  6  7  8  9

On the ith iteration, we discard the ith item and put that in our sequence. This is the 2nd iteration, so we discard the 2nd item. The sequence becomes: 1, 3. For our next iteration, we are going to shuffle the current iteration with the pattern above. We take the first unused item at the right of the ith item. This happens to be 4. We will append this to our new iteration:
 4

Now we're going to take the first unused item at the left of the ith item. This is 2. We will append this to our new iteration:
 4  2

Since there are no items left at the left of the ith item, we'll just append the rest of the sequence to the new iteration:
 4  2 [5] 6  7  8  9  10  11  ...

This is our 3rd iteration, so we'll discard the 3rd item, which is 5. This is the third item in our sequence:
 1, 3, 5

To get the next iteration, just repeat the process. I've made a gif if it isn't clear:

The gif took me longer than writing the actual post
Task

Given an non-negative integer n, output the first n terms of the sequence
You may provide a function or a program
This is code-golf, so the submission with the least amount of bytes wins!

Test cases:
Input: 4
Output: 1, 3, 5, 4

Input: 8
Output: 1, 3, 5, 4, 10, 7, 15, 8

Input: 15
Output: 1, 3, 5, 4, 10, 7, 15, 8, 20, 9, 18, 24, 31, 14, 28

Note: The commas in the output are not necessary. You may for example use newlines, or output a list, etc.

Julia, 78 71 bytes

n->[(i=j=x;while j<2i-3 j=i-(j%2>0?1-j:j+2)÷2;i-=1end;i+j-1)for x=1:n]

This is an unnamed function that accepts an integer and returns an integer array. To call it, assign it to a variable.

The approach here is the same as that described on OEIS.

Ungolfed:

# This computes the element of the sequence
function K(x)
    i = j = x
    while j < 2i - 3
        j = i - (j % 2 > 0 ? 1 - j : j + 2)÷2
        i -= 1
    end
    return i + j - 1
end

# This gives the first n terms of the sequence
n -> [K(i) for i = 1:n]

Saved 7 bytes thanks to Mauris!


What time is it in unicode? The challenge is simplistic, given an input time as a string in any one of the following formats:

hh, hh:mm or hh:mm:ss with 0 ≤ hh ≤ 23, 0 ≤ mm ≤ 59 and 0 ≤ ss ≤ 59.

Output what time it currently is using the following symbols:

AA  LABEL FOR CHARACTER     CODE POINT   HEXADECIMAL
==  ====================    ==========   ===========
  Clock Face 01 Oclock    128336       0x1F550
  Clock Face 02 Oclock    128337       0x1F551
  Clock Face 03 Oclock    128338       0x1F552
  Clock Face 04 Oclock    128339       0x1F553
  Clock Face 05 Oclock    128340       0x1F554
  Clock Face 06 Oclock    128341       0x1F555
  Clock Face 07 Oclock    128342       0x1F556
  Clock Face 08 Oclock    128343       0x1F557
  Clock Face 09 Oclock    128344       0x1F558
  Clock Face 10 Oclock    128345       0x1F559
  Clock Face 11 Oclock    128346       0x1F55A
  Clock Face 12 Oclock    128347       0x1F55B

In the following format:

It is currently {Clock Face 1} with {mm} minutes and {ss} seconds until {Clock Face 2}.

Examples (Including all fringe cases):

Case with only hours...

f("12") = "It is currently ."

Case with hours and minutes...

f("12:30") = "It is currently  with 30 minutes until ."

Case with only hours, but has minutes included as 00...

f("12:00") = "It is currently ."

Case with hours, minutes and seconds...

f("12:30:30") = "It is currently  with 29 minutes and 30 seconds until ."

Case with hours and minutes, but has seconds included as 00...

f("12:30:00") = "It is currently  with 30 minutes until ."

Case with hours and minutes, with less than a minute until the next hour...

f("12:59:59") = "It is currently  with 1 seconds until ."

You do not have to change from plural to singular.

Case with hours and minutes, with 1 minute to the next hour...

f("12:59") = "It is currently  with 1 minutes until ."

You do not have to change from plural to singular.

Case using military time (yes you must handle this)...

f("23:30:30") = "It is currently  with 29 minutes and 30 seconds until ."

Invalid cases...

f("PPCG") = This cannot occur, you are guaranteed a valid format by the definition of the problem.
f(66:66:66) = This cannot occur, you are guaranteed valid numbers by the definition of the problem.
f(24:60:60) = This cannot occur, you are guaranteed valid numbers by the definition of the problem.

You do not have to conform to any style of output for invalid cases, errors are fine.

Overall the challenge is rather simplistic, but seemed to be dynamic enough to be fun in my opinion. The shortest code here is the winner as there isn't much variable aspect to the code other than length.

JavaScript (ES6), 201
t=>(T=h=>String.fromCodePoint(128336+h%12),[h,m,s]=t.match(/\d+/g),'It is currently '+T(h-=~10)+((m-=-!!-s)?` with ${60-m?60-m+' minutes'+(-s?' and ':''):''}${-s?60-s+' seconds':''} until `+T(-~h):''))

Less golfed
t=>(
  T=h=>String.fromCodePoint(128336+h%12),
  [h,m,s]=t.match(/\d+/g),
  'It is currently '+T(h-=~10)
   +(
      // if seconds is not 0, increment m else just convert to number
      // have to use '- -' to force conversion to number
     (m -= - !!-s)
-s?++m:m)
      ? ` with ${60-m ? 60-m+' minutes'+(-s?' and ':''):''}${-s?60-s+' seconds':''} until `+T(-~h)
      : ''
    )
)

Test

F=
t=>(T=h=>String.fromCodePoint(128336+h%12),[h,m,s]=t.match(/\d+/g),'It is currently '+T(h-=~10)+((m-=-!!-s)?` with ${60-m?60-m+' minutes'+(-s?' and ':''):''}${-s?60-s+' seconds':''} until `+T(-~h):'')
)

var tid=0

function getTime(t)
{
  var a=t.match(/\d+/g)
  if (a) {
    var [h,m,s]=a
    h|=0, s|=0, m|=0
    if(h>=0 & h<24 & m>=0 & m<60 & s>=0 & s<60)
      return [h,m,s]
  }
  return null
}

function update()
{
  clearTimeout(tid)
  var t=I.value, a=getTime(t)
  if (a) {
    O.textContent = F(t)
    tid = setTimeout(again,5000)
  }
  else {
    O.textContent = 'invalid ' + t
  }
}
function again()
{
  var t=I.value, a=getTime(t)
  if (a) {
    var [h,m,s]=a
    ++s>59?(s=0,++m>59?(m=0,++h):0):0
    h%=24
    s<10?s='0'+s:0
    m<10?m='0'+m:0
    t = h+(-m-s?':'+m+(-s?':'+s:''):'')
    I.value = t
    O.textContent=F(t)
    tid = setTimeout(again, 1000)
  }
}

update()
#O { font-size:16px }
Time <input id=I value='12' oninput='update()' onkeydown='update()'>
(modify current time as you wish - but use valid values)


Given a list of strings, find all elements which are still in the list when any character is deleted Write a program using the fewest bytes of source code which given a list of strings finds all elements which are still in the list when any character is deleted.

For example, given a list of all English words boats would be output because oats, bats, bots, boas, boat are all English words and thus would be in the list.

Simple Pyhon code example, assuming words is the input list:

for w in words:
    has_all = True
    for i in range(len(w)):
        test = w[:i] + w[i+1:]
        if test not in words:
            has_all = False
            break
    if has_all
        print(w)

Example input list with some strings:

aorn (+)
aor (+)
arn
aon
orn (+)
ao
ar
or
rn
on

The strings marked with (+) are the ones that should be the output.

arn and aon shouldn't be output because we can delete the middle character to get an, which is not in the input list.

You should test that aba is not present on the output of this list:

aba
ba
aa
b

J, 11 bytes

*/@e.~1<\.]

Try it online!

J's "outfix" adverb \. does exactly what we need here.

Take the dictionary as the left arg (implicitly, via the overall dyadic hook), and the string to test as the right arg.

1<\.] Returns the box of every length 1 outfix of our right arg, that is, every copy with exactly 1 char deleted.
e.~ Asks if each of those is an element of the dictionary given  as the left arg. Returns a list of boolean zeros and ones.
*/@ Multiplies them all together, that is, are they all one?


Socket - Plug compatibility Traveling with electronics is always fun, especially when you need an adapter to charge them. Your challenge is to make planning a trip a little easier by checking if a given plug will be compatible with a given socket.
Challenge
Given a plug type and a socket type, return a value that indicates whether they will work together or not.
Compatibility table
Socket  Accepted plugs  |  Plug  Accepting Sockets
A       A               |  A     A, B
B       A, B            |  B     B
C       C               |  C     C, D, E, F, H, J, K, L, N, O
D       C, D, E, F      |  D     D
E       C, E, F         |  E     D, E, F, H, K, O
F       C, E, F         |  F     D, E, F, H, K, O
G       G               |  G     G
H       C, E, F, H      |  H     H
I       I               |  I     I
J       C, J            |  J     J
K       C, E, F, K      |  K     K
L       C, L            |  L     L
M       M               |  M     M
N       C, N            |  N     N
O       C, E, F, O      |  O     O

The tables show the same information, only transposed.
For reference.
Input

The input will be given as two uppercase or two lowercase letters (you choose).

Inputs will always be /[A-O]/ (or /[a-o]/), there's no need to handle invalid inputs.

You may accept the two inputs in any order (please specify which).

Input can be taken in any reasonable format (string, stdin, array, ...).

If you take both inputs in a single string, they can be separated by no more  than one character and there must be nothing surrounding them

Good inputs: "G,K", "EF", "a b", ['l', 'o']

Bad inputs: "K l", "f(O)(I)", [1,5]

Output

Output can be returned in any reasonable format.

Output must be either truthy/falsy or one of 2 constant values

Good outputs: false/any positive number, 1/2, 'T'/'F'

Bad outputs: an even number/an odd number, 1/more than 1

Examples
Using the format socket, plug => true / false.
A, A => true
I, K => false
O, C => true
C, O => false
E, F => true
F, E => true

Standard loopholes are disallowed.
This is code-golf so the answer with the fewest bytes in each language wins.

Retina 0.8.2, 30 29 bytes

(.)\1|[DEFHKO][CEF]|[JLN]C|BA

Try it online! Link includes test cases.


Scoop me an icecream please Make me an icecream cone please

We have a ton of great ice cream places here in New England.  Most of them are closed for the winter now, so...

   .-@@-.
  (======)
 (--------)
(==========)
(__________)
 \/\/\/\/\/
  \/\/\/\/
   \/\/\/
    \/\/
     \/

GOAL
  Output the above icecream cone exactly. (or return it from a function)

This is code golf so shortest answer wins

SOGL V0.12, 24 bytes
u%⅝⁾⁷‰┘Η:⅛6s⁹№K⌠RΝīL°‘§╬

Try it Here!
A simple compression solution:
....‘    push "@-.¶===(¶----(¶=====(¶_____(¶\/\/\¶/\/\¶\/\¶/\¶\"
     §   pad with spaces and reverse horizontally
      ╬  palindromize with 0 overlap and mirroring the characters

No compression version - way longer as SOGLs compression works nice for this


Create a solar system Intro

This is based on an actual problem I recently faced while making a computer game and I thought it would make for a nice round of code-golf.

There are seven main spectral classes of star which put out varying amounts of heat. The geology of planets around a star are greatly influenced by the amount of heat received from the star, which is a factor of spectral class and distance from the star. Hence Mercury is practically molten, Neptune frozen.

The galaxy in my game is procedurally generated and randomly selecting planet types for given stars turned out to be a real 'if statement hell'!

The challenge

Your method should select one planet from a list of planet types appropriate for the class of star, based on a minimum heat threshold, a maximum heat threshold and a random number.
For simplicity this challenge will only use a class G star, just like our sun.

Inputs

An integer heat in the range 4 to 11 representing the amount of heat received by the planet from the star.

Variables

This table shows the possible planets based on heat. Your method should first narrow the available choices based on the heat min and heat max, heat should fall on or between the two. E.g. with a heat of 10 passed in the only choices would be Desert, Iron and Lava.

Planet type    Heat min   Heat max   Random Chance
Gas Giant         4          9            15
Ice               4          6            10
Ice Giant         4          6            10
Gaia class        5          7            10
Dense Atmosphere  7          9            10
Desert            7          10           25
Iron              7          10           14
Lava             10          11           6

Next, the probability of a planet (in the remaining choices) being chosen is its random chances divided by the sum of the random chances of all the choices.

In the above example, the probability of Iron being chosen is 14/(25+14+6).

Output

Return the planet type as a string.

Do the best you can to avoid logic arrowheads. Shortest code wins, points all round for creativity. Happy golfing!

Jelly, 78 bytes
“'ĖøÆḳƙ’ḃ7ṣ6+\+3r/ċ€×“½½½½©ÐÇı‘
“ŀỊẋ8ƒ³ẈRɼƈñqẋẏȧɱḌ<ṄỴḳ⁾ÆʋeẒĊ'@ƬØƓƝ}ḟ¬»ỴW€ẋ"ÇẎX

A monadic link accepting an integer (in [4,11]) which returns a list of characters.
Try it online!
How?
Creates the heat ranges of the planets as a list of lists and counts the occurrences of the input heat in those lists to get a list of zeros and ones representing which planet types are possible, then multiplies by the likelihood numbers of the eight planet types to get the distribution. The distribution is used to repeat the planet type names, and finally a uniform random choice is made.
“'ĖøÆḳƙ’ḃ7ṣ6+\+3r/ċ€×“½½½½©ÐÇı‘ - Link 1, getDistribution: integer
“'ĖøÆḳƙ’                        - base 250 integer = 39824688429662
        ḃ7                      - to bijective-base 7 = [1,1,2,4,7,1,4,4,6,2,2,2,2,1,5,3,3]
          ṣ6                    - split at sixes = [[1,1,2,4,7,1,4,4][2,2,2,2,1,5,3,3]]
             \                  - cumulative reduce with:
            +                   -   addition = [[1,1,2,4,7,1,4,4][3,3,4,6,8,6,7,7]]
              +3                - add three = [[4,4,5,7,10,4,7,7],[6,6,7,9,11,9,10,10]]
                 /              - reduce with:
                r               -   inclusive range = [[4,5,6],[4,5,6],[5,6,7],[7,8,9],[10,11],[4,5,6,7,8,9],[7,8,9,10],[7,8,9,10]]
                  ċ€            - count (input) in €ach e.g. for 5: [1, 1, 1, 0,0, 1, 0, 0]
                     “½½½½©ÐÇı‘ - list of code-page indices        [10,10,10,10,6,15,14,25]
                    ×           - multiply                         [10,10,10, 0,0,15, 0, 0]

“ ... »ỴW€ẋ"ÇẎX - Main link: integer
“ ... »         - compressed string = "Ice\nIce Giant\nGaia class\nDense Atmosphere\nLava\nGas Giant\nIron\nDesert"
       Ỵ        - split at new lines = ["Ice","Ice Giant","Gaia class","Dense Atmosphere","Lava","Gas Giant","Iron","Desert"]
        W€      - wrap €ach in a list
            Ç   - call last link (1) as a monad e.g. for 5: [10,10,10,0,0,15,0,0]
           "    - zip with:
          ẋ     -   repeat e.g. for 5:  [["Ice","Ice","Ice","Ice","Ice","Ice","Ice","Ice","Ice","Ice"],["Ice Giant","Ice Giant","Ice Giant","Ice Giant","Ice Giant","Ice Giant","Ice Giant","Ice Giant","Ice Giant","Ice Giant"],["Gaia class","Gaia class","Gaia class","Gaia class","Gaia class","Gaia class","Gaia class","Gaia class","Gaia class","Gaia class"],["Gas Giant","Gas Giant","Gas Giant","Gas Giant","Gas Giant","Gas Giant","Gas Giant","Gas Giant","Gas Giant","Gas Giant","Gas Giant","Gas Giant","Gas Giant","Gas Giant","Gas Giant"]]
             Ẏ  - tighten               ["Ice","Ice","Ice","Ice","Ice","Ice","Ice","Ice","Ice","Ice","Ice Giant","Ice Giant","Ice Giant","Ice Giant","Ice Giant","Ice Giant","Ice Giant","Ice Giant","Ice Giant","Ice Giant","Gaia class","Gaia class","Gaia class","Gaia class","Gaia class","Gaia class","Gaia class","Gaia class","Gaia class","Gaia class","Gas Giant","Gas Giant","Gas Giant","Gas Giant","Gas Giant","Gas Giant","Gas Giant","Gas Giant","Gas Giant","Gas Giant","Gas Giant","Gas Giant","Gas Giant","Gas Giant","Gas Giant"]
              X - a random choice from that list


Zigzag this string by collapsing duplicates Given a string, your task is to collapse it into a zigzag-like structure as described below.

Folding into a Zigzag

We'll take the string "Mississippi" as an example:

First, output the longest prefix consisting of unique characters only:

Mis

When you reach the first duplicate character C, ignore it, and output the longest prefix consisting of unique characters of the remaining string (issippi) vertically, below the first occurrence of C:

Mis
  i
  s

Repeat the process, alternating between horizontal and vertical continuation. But now be careful (at step 1) to continue outputting horizontally from latest occurrence of the duplicate character, which is not necessarily the last one, as in this case:

Mis
  i
  sip
-----
Mis
  i
  sip
    i

Rules

The string will only contain printable ASCII characters, but won't contain any kind of whitespace.
You can compete in any programming language and can take input and provide output through any standard method and in any reasonable format1, while taking note that these loopholes are forbidden by default. This is code-golf, so the shortest submission (in bytes) for every language wins.
1 Input: String / List of characters / whatever else your language uses to represent strings. Output: Multiline string, list of strings representing lines or list of lists of characters/length-1 strings, but please include a pretty-print version of your code in your answer, if possible.
Regarding additional spaces, the output may contain:

Leading / trailing newlines
Trailing spaces on each line / at the end
A consistent number of leading spaces on each line

You must begin to output horizontally, you may not start vertically.

Test cases

Inputs:

"Perfect"
"Mississippi"
"Oddities"
"Trivialities"
"Cthulhu"
"PPCG"
"pOpOpOpOpOpOp"
"ABCCCE"
"ABCCCECCEEEEC"
"abcdcebffg"
"abca"
"AAAAAAAA"

Corresponding outputs:

Perf
 c
 t

Mis
  i
  sip
    i

Od
 ies
 t

Triv
  a
  l
  ies
  t

Cthul
  u

P
C
G

pO
OpO
pOp
 p

ABC
  C
  E

ABC
  CCE
  E EC

abcd
  e
  b
  fg

abc

A
AA
 A

Wolfram Language (Mathematica), 143 bytes

{#}//.{q___,a_,r___,a_,Longest@s___}:>{q}~f@{a,r}~{{s}}//.{q_~f@a_~s_}/;s~FreeQ~f:>(PadLeft@{q~Join~#,##2}&)@@PadRight@Join[{a},s]/. 0->" "&

Try it online!

Contains 0xF8FF, which corresponds to the \[Transpose] operator.

Phew, it was tough making the result into a string. Getting each branch isn't so tough: #//.{q___,a_,r___,a_,Longest@s___}:>{q,a,{r},{s}}&


Coding in song - Representing music lyrics in a programming language of your choosing Write a program in the language of your choosing which when read are the lyrics to a song.  It must be a valid program which can be compiled and run without errors.  While you could technically print to the screen all the lyrics, you're encouraged to do it with style and avoiding string literals whenever possible.

Given that this is difficult on of itself, you're allowed to write a single section of boilerplate code which doesn't count towards being readable in the lyrics.  However, once the block of code begins which must be read as the lyrics to a song, you cannot interrupt it until the song is finished.  You can indicate the beginning and end of the song code with comments.  Please also specify the lyrics themselves as you would read the code.  You can be "liberal" with your interpretation so long as you don't stray too far from what's written, otherwise it will cost you points.

Partial song lyrics are allowed, though you get double points for having the words to an entire song.  Judging is divided into 3 categories:

10 points - Originality
10 points - Song difficulty
20 points - Representation of that song in code.

For each submission, I'll give you your score in a comment below. If you edit your answer, just give me a comment indicator and I'll re-evaluate it accordingly.  However in order to be fair, each re-evaluation subtracts 2 points from your total score.

An example might be the following:

public class Song {
    public String play() {
        // Song begin
        try {
            if(this instanceof TheRealLife || this instanceof JustFantasy) {
                throw new InALandSlide();
            }
        } catch (InALandSlide e) {
        }
        return "No \"FromReality\"";
        // Song end
    }

    public static void main(String [] args) {
        Song song = new Song();
        song.play();
    }
}

Which gets read:

Is this TheRealLife?
Or is this JustFantasy?
Caught InALandSlide.
No escape \"FromReality\"

Instrumentals aren't allowed, wise guys.  ;)

Python - 8+4+15 = 27 points

Here's on couple of stanzas from The Hunting of the Snark by Lewis Carroll.
It calculates a number, based on the algorithm suggested in the poem, and uses it to state a proof about the voice of the jubjub.

class taking:
    def __init__(self, n): convenient.val = (n)
    def __enter__(self): pass
    def __exit__(self, type, value, traceback): pass
def a(x,y): x.val = y(x.val); return True
class We:
    def __init__(self): self.val=0
    def __add(self, y): return y+sum(self.x)
    def add(self, *x): self.x = x; return self.__add
    def multiply(self,x,by,diminished_by): self.val *= by-diminished_by
    def proceed2divide(self,x,by): self.val /= by
    def subtract(self,x): self.val -= x; return True
perfectly = lambda x: x and not not x
def must_be(x):
    if x:
        print "\n".join(["Tis the %s of the Jubjub!"%["voice","note","song"][x%3] for x in range(out.val)])
        return out.val
out=convenient=as_you_see=we=then=the=We()
_ = exactly = 15
with\
\
    taking(3) as the_subject_to_reason_about:
    a(convenient, #2 state
    we.add(7,_ & 10)) and then.multiply(out,
    by=1000, diminished_by=8)

    the_result = we.proceed2divide(as_you_see,
    by=992)
    then.subtract(17) and the; answer = must_be(
    exactly and perfectly(True))

The original text:

  "Taking Three as the subject to reason about—
     A convenient number to state—
   We add Seven, and Ten, and then multiply out
     By One Thousand diminished by Eight.

  "The result we proceed to divide, as you see,
     By Nine Hundred and Ninety Two:
   Then subtract Seventeen, and the answer must be
     Exactly and perfectly true.


Chess960 position lookup This is a follow-up to Chess960 position generator.

In Chess960, there are 960 possible starting positions that can be enumerated from 0 to 959 (or, at your choice, from 1 to 960). The enumeration scheme is defined in http://en.wikipedia.org/wiki/Chess960_numbering_scheme:

  White's Chess960 starting array can be derived from its number N (0
  ... 959) as follows:

  a) Divide N by 4, yielding quotient N2 and remainder B1. Place a
  Bishop upon the bright square corresponding to B1 (0=b, 1=d, 2=f,
  3=h).

  b) Divide N2 by 4 again, yielding quotient N3 and remainder B2. Place
  a second Bishop upon the dark square corresponding to B2 (0=a, 1=c,
  2=e, 3=g).

  c) Divide N3 by 6, yielding quotient N4 and remainder Q. Place the
  Queen according to Q, where 0 is the first free square starting from
  a, 1 is the second, etc.

  d) N4 will be a single digit, 0 ... 9. Place the Knights according to
  its value by consulting the following table:

Digit     Knight positioning
0         N   N   -   -   -
1         N   -   N   -   -
2         N   -   -   N   -
3         N   -   -   -   N
4         -   N   N   -   -
5         -   N   -   N   -
6         -   N   -   -   N
7         -   -   N   N   -
8         -   -   N   -   N
9         -   -   -   N   N

  e) There are three blank squares remaining; place a Rook in each of
  the outer two and the King in the middle one.

You can find the complete table at http://www.mark-weeks.com/cfaa/chess960/c960strt.htm.

Your task: Write a program that takes an integer as its input and returns the white baseline pieces for that index, e.g.

f(1) = "BQNBNRKR"
f(518) = "RNBQKBNR"

Or, you might as well use unicode "♖♘♗♕♔♗♘♖" if your language supports that.

For your inspiration, here's a pretty straight-forward (not optimized) JS implementation: http://jsfiddle.net/Enary/1/

Python, 179 chars

i=input()
a=i%4*2+1
b=i/4%4*2
c=i/16%6
d=i/96*5
s='NNRKRNRNKRNRKNRNRKRNRNNKRRNKNRRNKRNRKNNRRKNRNRKRNN'[d:d+5]
s=s[:c]+'Q'+s[c:]
if a>b:a,b=b,a
print s[:a]+'B'+s[a:b-1]+'B'+s[b-1:]

Builds it backwards from the description order so we don't have to count the spaces that are already taken.


Program ordinals and omega squared A program ordinal is a (possibly transfinite) ordinal which can be assigned to programs in some language depending on their output.

To be more specific:

Strings that give no output have ordinal 0
Programs that output a program of ordinal n have ordinal n+1
Programs P0 outputting multiple programs P1, P2... Pn have ordinal S, where S is the supremum of the set of program ordinals corresponding to the programs P1, P2... Pn

Your goal is to create the shortest possible program with program ordinal ω*ω, also writable as ω2 or omega squared.

Output is required for a program. As well as this, the output must go through STDOUT or closest equivalent.

All programs printed by your program must be delimited by any string, so long as the delimiter is always the same. (acbcd and accbccd are allowed, but not acbed) These delimiters must be the only output other than the programs themselves, unless your language must output trailing characters.

Here is a program-ordinal ω program created in pseudocode, which generates programs of the form "exit, print(exit), print("print(exit)")...:

x=exit
loop{
print(x)
x='print(#x)'
}

Within each iteration of the loop, x is printed and then wrapped in print() (exit becomes print(exit)). # is put before x in pseudocode to indicate that it is the variable x and not the actual alphabetical character x.

The shortest program (measured in bytes) which has program ordinal ω2 wins. Have fun.

Python 2, 67 63 65 bytes

x=""
while 1:x="x=%r\nwhile 1:x='print%%r;'%%x;exec x;"%x;print x

Try it online!
Use the same strategy as @UnrelatedString's answer, be sure to check out and upvote his answer!
Repeatedly print out programs with ordinal \$0, \omega, \omega2, \omega3,\ldots \$. The programs are separated by the string ";\n" (a semi-colon and a new line).
68 bytes to separate programs by a blank line.
Explanation
A program with ordinal \$n+1\$ is created by adding a print statement around an \$n\$-ordinal program:
print <escaped string of ordinal-n program>

A program with ordinal \$\omega(n+1)\$ is created by repeatedly printing out programs with ordinal \$\omega n, \omega n+1,\omega n+2,\ldots\$
x = <string of omega*n program>
while 1:
  x = 'print %r' % x
  exec x

Note the use of %r, which escapes the given string x. This way, we don't have to worry about quote and new line characters.
Finally, a program with ordinal \$\omega^2\$ is created by repeatedly printing out programs with ordinal \$0, \omega, \omega 2,\omega 3,\ldots\$:
# string of program to go from omega*n to omega*(n+1)
s = "x=%r\nwhile 1:x='print%%r'%%x;exec x"
# current omega*n program, start with n=0
x = ""
while 1:
  # create the omega*(n+1) program from omega*n
  x = s % x
  # print it out
  print x


5, 2, 16, 3580, What comes next? Consider the positive integer powers of five in decimal. Here are the first 25, right aligned:

 X                5^X
 1                  5
 2                 25
 3                125
 4                625
 5               3125
 6              15625
 7              78125
 8             390625
 9            1953125
10            9765625
11           48828125
12          244140625
13         1220703125
14         6103515625
15        30517578125
16       152587890625
17       762939453125
18      3814697265625
19     19073486328125
20     95367431640625
21    476837158203125
22   2384185791015625
23  11920928955078125
24  59604644775390625
25 298023223876953125

Notice that the rightmost column of the powers is all 5's. The second column from the right is all 2's. The third column from the right, read from top to bottom, alternates 1, 6, 1, 6, etc. The next column starts 3, 5, 8, 0 and then cycles.

In fact, every column (if we go down far enough) has a cycling sequence of digits whose length is twice that of the previous cycle, except for the initial 5's and 2's cycles.

Calling N the column number, starting with N = 1 at the right, the first few cycles are:

N cycle at column N
1 5
2 2
3 16
4 3580
5 17956240
6 3978175584236200
7 19840377976181556439582242163600
8 4420183983595778219796176036355599756384380402237642416215818000

Challenge

Given a positive integer N, output the decimal digits of the cycle at column N, as described above. For example, the output for N = 4 would be 3580.

The digits may be output as a list such as [3, 5, 8, 0] or in another reasonable format so long as:

The digits are in order as read from top to bottom in the power columns. e.g. 0853 is invalid.
The cycle starts with the top number in its power column. e.g. 5803 is invalid as the 4th column starts with 3 not 5.
Exactly one cycle is output. e.g. 358 or 35803 or 35803580 would all be invalid.

Your code must work for at least N = 1 through 30.

If desired you may assume the columns are 0-indexed instead of 1-indexed. So N = 0 gives 5, N = 1 gives 2, N = 2 gives 16, N = 3 gives 3580, etc.

The shortest code in bytes wins.

Thanks to Downgoat and DJ for challenge support.

Python 2, 62 61 58 bytes

Zero-based. I assume the L suffixes are acceptable.

lambda n:[5**(n*3/7-~i)/2**n%10for i in range(2**n/2or 1)]

Output:

0 [5]
1 [2]
2 [1, 6]
3 [3, 5, 8, 0]
4 [1, 7, 9, 5, 6, 2, 4, 0]
5 [3, 9, 7, 8, 1, 7, 5, 5, 8, 4, 2, 3, 6, 2, 0, 0]
6 [1, 9, 8, 4, 0, 3, 7, 7, 9, 7, 6, 1, 8, 1, 5, 5, 6, 4, 3, 9, 5, 8, 2, 2, 4, 2L, 1L, 6L, 3
L, 6L, 0L, 0L]
7 [4, 4, 2, 0, 1, 8, 3, 9, 8, 3, 5, 9, 5, 7, 7, 8, 2, 1, 9, 7, 9, 6, 1, 7, 6L, 0L, 3L, 6L,
3L, 5L, 5L, 5L, 9L, 9L, 7L, 5L, 6L, 3L, 8L, 4L, 3L, 8L, 0L, 4L, 0L, 2L, 2L, 3L, 7L, 6L, 4L,
 2L, 4L, 1L, 6L, 2L, 1L, 5L, 8L, 1L, 8L, 0L, 0L, 0L]

Previous solution:

lambda n:[5**int(n/.7-~i)/10**n%10for i in range(2**n/2or 1)]
lambda n:[str(5**int(n/.7-~i))[~n]for i in range(2**n/2)]or 5

Explanation:

def f(n):
    r = max(2**n / 2, 1)
    m = int(n/0.7 + 1)
    for i in range(r):
        yield (5**(m+i) / 10**n) % 10

The range(2**n/2) uses the observation that each cycle has length r = 2n-1 except when n = 0, so we just compute the n-th digits for 5m to 5m + r - 1.

The start of the cycle 5m is the first number larger than 10n. Solving 5m ≥ 10n gives m ≥ n / log10 5. Here we approximate log10 5 ≈ 0.7 which will break down when n = 72. We could add more digits to increase the accuracy:

| approximation             | valid until        | penalty   |
|---------------------------|--------------------|-----------|
| .7                        | n = 72             | +0 bytes  |
| .699                      | n = 137            | +2 bytes  |
| .69897                    | n = 9297           | +4 bytes  |
| .698970004                | n = 29384          | +8 bytes  |
| .6989700043               | n = 128326         | +9 bytes  |
| .6989700043360189         | too large to check | +15 bytes |
| import math;math.log10(5) | same as above      | +23 bytes |

The / 10**n % 10 in the loop simply extract the desired digit. Another alternative solution uses string manipulation. I used the trick ~n == -n-1 here to remove 1 byte.

An mentioned in the comment, the expression 5**(m+i) / 10**n can further be simplified this way, which gives the current 58-byte answer.

(The division x/2**n can be done using bitwise right-shift x>>n. Unfortunately, due to Python's operator precedence this does not save any bytes.) The fraction 3/7 can also be improved in similar mannar:

| approximation                   | valid until         | penalty   |
|---------------------------------|---------------------|-----------|
| n*3/7                           | n = 72              | +0 bytes  |
| n*31/72                         | n = 137             | +2 bytes  |
| n*59/137                        | n = 476             | +3 bytes  |
| n*351/815                       | n = 1154            | +4 bytes  |
| n*643/1493                      | n = 10790           | +5 bytes  |
| n*8651/20087                    | n = 49471           | +7 bytes  |
| int(n*.43067655807339306)       | too large to check  | +20 bytes |
| import math;int(n/math.log2(5)) | same as above       | +26 bytes |


How tall are the monoliths? Here is an example of an input of monoliths. There are 4 in this example.
  _
 | |        _
 | |  _    | |
 | | | |   | |     _
_| |_| |___| |____| |_

The first monolith is 4 units high, the second is 2, the third is 3, and the last is 1.
The task
Your program should output the heights of the monoliths in order from left to right. The output format can be in any sort of list or array.
Notes

The input can be taken as any dimensional string, list of strings, or list of characters.
This is code-golf, so lowest bytes wins.
You are to assume that monoliths always have the same width, and are always at least 1 _ away from another.
They can come in any height, and in any quantity.

I/O
  _
 | |        _
 | |  _    | |
 | | | |   | |     _
_| |_| |___| |____| |_   >> [4,2,3,1]

           _
          | |
  _       | |
 | |  _   | |  _
_| |_| |__| |_| |_   >> [2,1,4,1]

 _   _   _
| |_| |_| |_____   >> [1,1,1]

____________________   >> undefined behavior

 _
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |   >> [11]

     _       _       _       _       _
 _  | |  _  | |  _  | |  _  | |  _  | |
| |_| |_| |_| |_| |_| |_| |_| |_| |_| |  >> [1,2,1,2,1,2,1,2,1,2]

Jelly, (8?) 9 bytes

Ỵ=”|Sḟ0m2

A monadic link accepting a list of characters as specified and returning a list of integers.

Note: 8 bytes if a list of strings, one per line, was really intended to be an allowed input format - just remove the Ỵ.

Try it online!

How?

Ỵ=”|Sḟ0m2 - Link: list of characters, s
Ỵ         - split at newlines
  ”|      - literal '|'
 =        - equals (vectorises)
    S     - sum (vectorises, hence counts the number of '|' in every column)
     ḟ0   - filter out zeros (only keep the results from the sides of the towers)
       m2 - modulo index with 2 (keep only the left side measurements)


Resource for generating shortest regex given a list of strings I'm looking for a program such that, given a finite list of strings, can find short regexes to match exactly all of them and nothing else.
Since there are multiple languages that express regexes differently, there can correspondingly be multiple regex generators. Each answer must discuss regex generation in one langauge only (or a family of languages for which there is a direct correspondence between regexes in each of them).

The Machine Learning Lab at the University of Trieste, Italy, wrote a web app to solve this exact problem, available at: Automatic Generation of Regular Expressions from Examples based on "genetic programming" and published a paper about it. Based on the fact that it had to come from the Machine Learning Lab of a university in Italy, and was worth publishing a paper about, it is probably a pretty hard problem to solve. Doesn't sound like the type of question for Code Golf SE, but I'm new here, so I wouldn't be the expert on that.


The World's Smallest Web Browser Backstory:

  You enjoy your new programming job at a mega-multi-corporation. However, you aren't allowed to browse the web since your computer only has a CLI. They also run sweeps of all employees' hard drives, so you can't simply download a large CLI web browser. You decide to make a simple textual browser that is as small as possible so you can memorize it and type it into a temporary file every day.

Challenge:

Your task is to create a golfed web browser within a command-line interface. It should:

Take a single URL in via args or stdin
Split the directory and host components of the URL
Send a simple HTTP request to the host to request the said directory
Print the contents of any <p> paragraph </p> tags
And either exit or ask for another page

More Info:

A simple HTTP request looks like this:

GET {{path}} HTTP/1.1
Host: {{host}}
Connection: close
\n\n

Ending newlines emphasized.

A typical response looks like:

HTTP/1.1 200 OK\n
<some headers separated by newlines>
\n\n
<html>
....rest of page

Rules:

It only needs to work on port 80 (no SSL needed)
You may not use netcat
Whatever programming language is used, only low-level TCP APIs are allowed (except netcat)
You may not use GUI, remember, it's a CLI
You may not use HTML parsers, except builtin ones (BeautifulSoup is not a builtin)
Bonus!! If your program loops back and asks for another URL instead of exiting, -40 chars (as long as you don't use recursion)
No third-party programs. Remember, you can't install anything.
code-golf, so the shortest byte count wins

Pure Bash (no utilities), 200 bytes - 40 bonus = 160
while read u;do
u=${u#*//}
d=${u%%/*}
exec 3<>/dev/tcp/$d/80
echo "GET /${u#*/} HTTP/1.1
host:$d
Connection:close
">&3
mapfile -tu3 A
a=${A[@]}
a=${a#*
}
a=${a%
*}
echo "${a//<\/p>*
/"
"}"
done

I think this is up to the spec, though of course watch out for parsing HTML using regex I think the only thing worse than parsing HTML using regex is parsing HTML using shell pattern matching.
This now deals with
...
 spanning multiple lines.  Each
...
 is on a separate line of output:
$ echo "http://example.com/" | ./smallbrowse.sh
This domain is established to be used for illustrative examples in documents. You may use this     domain in examples without prior coordination or asking for permission.
More information...
$


Find the Serialized Integer Task
Write a program that will take (as input) a positive integer.  It will then count up from 0, appending each integer to a String, only continuing if the length of the String is less than the value of the input.
A serialized integer is defined as the fully-formed integer with the maximum value belonging to the String.  By "fully-formed", the integer should have no missing digits (which would occur if the length constraint of the String is met).
The output of the program should be the serialized integer for its respective, positive input.

Rules

It's code golf, so the shortest answer (in bytes) wins!
Input will always be positive.
The output must be an integer in base-10 (decimal).
The program must be 0-indexed.

Example Input | Output
   5 | 4   (0 1 2 3 4              - Length of 5)
  11 | 9   (0 1 2 3 4 5 6 7 8 9 1  - Length of 11)
  12 | 10  (0 1 2 3 4 5 6 7 8 9 10 - Length of 12)
1024 | 377 (0 1 2 3 4 5 6 7 8 ...  - Length of 1024)

Note(s)

If you have any questions (or would like me to provide more examples), please comment!
Inspiration: https://stackoverflow.com/questions/45034478/how-do-i-calculate-the-maximum-serialized-integers-in-1024-length-limit

JavaScript (ES6), 40 37 bytes

f=(n,i=s='0')=>(s+=++i)[n]?i-1:f(n,i)
<input type=number min=1 value=1 oninput=o.textContent=f(this.value)><pre id=o>0

Edit: Saved 3 bytes with some help from @Arnauld.


recursive power algorithm Have a look at my (javascript) version of a O(log(n)) xn algorithm:

function pow(x,n)
{
     return n==0?1:n==1?x:n==2?x*x:pow(pow(x,(n-n%2)/2),2)*(n%2==0?1:x);
}

Can you get it shorter?


A very long Terza Rima Description

Output the rhyme scheme for a very long Terza Rima.

Input

None.

Output

ABA
BCB
CDC
DED
EFE
FGF
GHG
HIH
IJI
JKJ
KLK
LML
MNM
NON
OPO
PQP
QRQ
RSR
STS
TUT
UVU
VWV
WXW
XYX
YZY

Rules

You can pick between separating stanzas with whitespace or newlines, so either:

ABA BCB...

OR

ABA
BCB
...

A single trailing whitespace allowed per line and one trailing newline allowed.

Output can be either uppercase or lowercase.

This is code-golf, so the shortest code in bytes for each language wins.


Eating Candy in the Correct Order When it comes to eating candy, I hold myself to higher standards than the typical layperson.  There is a delicate balance between "mixing it up" and "saving the best for last."

In this challenge, you will be given a string of characters in which each character represents a piece of candy.  Different characters (case-sensitive) represent different types of candy. Your program must then determine the correct order of candy consumption, based on the procedure below. You can write either a complete program (STDIN/STDOUT) or a named function to accomplish this task.

Let's say that my candy stash is oroybgrbbyrorypoprr.  First, I sort the candy into piles of the same type, with larger quantities at the top, using lower ASCII character values as a tie-breaker.

rrrrrr
oooo
bbb
yyy
pp
g

Then, I take each row of candy and equally-space them along an interval.  For example, if there are 3 pieces of candy, one is placed 1/3 of the way, 2/3 of the way, and at the end.

.r.r.r.r.r.r
..o..o..o..o
...b...b...b
...y...y...y
.....p.....p
...........g

Then, I go down each column to create my final candy order, rorbyroprbyorrobypg.

Input

A string which contains the candy stash.  The input for the above example could have been:

oroybgrbbyrorypoprr

Output

A string containing the candy reorganized into the correct order of consumption.

rorbyroprbyorrobypg

Scoring

This is code golf.  The shortest answer in bytes wins.  Standard code-golf rules apply.

CJam, 78 68 61 45 42 39 31 30 bytes
l$:L{L\/,~}${:DM+:MD/,LD/,d/}$

Takes the input string via STDIN
Inspired by recursive's approach, but a little different. No need of transpose or rectangle at all!.
How it works:
l$:L                              "Sort the input line and store it in L";
    {     }$                      "Sort the string based on this code block output";
     L\/,~                        "Sort based on number of occurrences of each";
                                  "character in the full string";
            {               }$    "Sort the sorted string again";
             :DM+:M               "Store each character in D, add to M and update M";
                   D/,            "Count occurrences of D in M";
                      LD/,        "Count occurrences of D in L";
                          d/      "Sort string based on the ratio of two occurrences";

(Sad that CJam can no longer complete with Pyth due to need of so much bloat as syntax)
Try it here


Plumbing Random Paths Write a program or function that takes in three integers, a width w, a height h, and a step count s. You will be drawing a non-self-intersecting random walk s steps long on a 5*w by 5*h pixel image where every 5 by 5 pixel cell is either empty (pure beige) or one of these twelve simple "pipes":

The image above is enlarged to show detail. Here are the pipes at actual size:

(The gray lines are just to separate the pipe types.)

The random walk will be a single continuous pipe path that starts at one pipe endpoint (one of the bottom four pipe types) and ends at another pipe endpoint.

Start with an empty w by h grid and randomly choose one cell to be the starting point. Then randomly choose one of the four directions to start in and draw the corresponding pipe endpoint. This starting cell marks the first step in your walk and every time you draw a new cell or overwrite an existing one it counts as another step taken.

Now, repeatedly, randomly choose to go right, left, or straight, drawing the appropriate pipe cell if the direction chosen is valid. Backtrack and re-choose if a direction is not valid until the complete s step path is formed. The path should end with a pipe endpoint, which might be anywhere on the grid, depending on the course the path took.

It is very important to note that only the two straight pipe cells can be overwritten, and only by the straight pipe cell of the opposite orientation, the result being an intersection cell. Otherwise, all pipes must be placed in empty cells.

When an intersection is drawn, the part of the path that is further along from the starting cell should be drawn on top.

It is up to you whether or not the grid has periodic boundary conditions (PBC), i.e. whether a pipe exiting one side of the grid will come out on the other side. Without PBC the grid boundary counts as a barrier that you can run into just like other pipes.

Special Cases

When s is 0 no pipes should be drawn and the output should be a blank 5*w by 5*h image (i.e. all beige).
When s is 1 a single pipe stub

 (Actual size: )

should be drawn at the randomly chosen starting cell.

Other Details

You may assume that s is at most w*h so a path will always be possible. (Though longer paths are possible due to intersections.)
w and h will always be positive.
All random choices must be uniformly random. e.g. you shouldn't avoid making intersections when they are possible even if it makes the problem easier. Pseudo-random number generators are allowed.
Any three visually distinct colors may be used in place of the black, blue, and beige.
Your output images may be enlarged so that they are really 5*w*k by 5*h*k pixels where k is a positive integer. (Enlarging any examples you post is advised even if your k is 1.)
Any common lossless image file format may be used and the image may be saved to a file, displayed, or spewed raw to stdout.

The shortest code in bytes wins.

Examples

(All enlarged by 500%.)

If the input is w=2, h=1, s=0 then the output will always be:

If the input is w=2, h=1, s=1 then the output will be one of these images with equal chance:

If the input is w=2, h=1, s=2 then the output will be

or possibly

if the grid is assumed to have PBC.

(Note that starting the path like  would make a second step impossible.)

Here are some possible outputs for w=3, h=2, s=6, assuming PBC:

Here is a possible output for w=3, h=3, s=9, assuming PBC:

Notice that the path didn't need to cover all the cells due to the intersection counting as two steps. Also, we can deduce that the corner endpoint was the starting cell since the intersection overpass must have been drawn afterwards. Thus we can infer the sequence of random choices that were made:

start at top left, facing east
go straight
go right
go right
go right
go straight
go left
go right
end

Finally, here are examples of w=4, h=5, s=20 and w=4, h=5, s=16:

CJam, 274

q~:K;:B;:A;{0aA*aB*:M5*5f*:I;K{[Bmr:QAmr:P]5f*:R;3Ym*{R.+:)2{1$0=I=2$W=@tI@0=@t:I;}:F~}/R2f+1FK({MQ=P=:EY4mr:D#&1{{MQMQ=PE2D#+tt:M;}:G~7,1>[W0_1_0_W]2/D=:Off*{[QP]5f*2f+.+_:H1F_OW%.+2FOW%.m2F}/H2FO~P+:P;Q+:Q;MQ=P=:E_5YD2%-*=!JK2-=+*1{D2+4%:D;G}?}?}fJ]}0?}g'P2NA5*SI,N2NI:+N*

Try it online

Uses PBC, outputs in PGM format. You can remove the :+ near the end to get a nicer visual output in the browser.

It's very slow for larger input, especially if the step count is close to the area.

Example result for input 4 3 10 (scaled 500%):

Brief explanation:

The general approach is:

repeat all the following steps until successful:
initialize 2 matrices: one recording which sides are being used in each cell, and one for the image
if s=0, we're done, else:
pick a random cell and draw a square, then do the following s-1 times:
pick a random direction; if that side is already used, fail and start over
mark the side as used and draw the actual pipe in the image (drawing 3 adjacent lines of length 6, starting right "after" the center pixel of the current cell, then adding a dot to cap the end of the pipe)
update the current position (moving to the next cell)
check if the cell is empty or it's a valid crossing; if not, fail and start over
mark the side in the opposite direction as used in this cell, then continue the loop


Put on your sunglasses Introduction

You are probably familiar with the "puts on sunglasses" emoticon-meme:

(•_•)
( •_•)>⌐■-■
(⌐■_■)

In this challenge, your task is to take the first line as input, and output the last one, effectively putting sunglasses on that little button-eyed person.
To make the task a bit more difficult, the characters have been scaled up and converted to (ugly) ASCII art.

Input

Your input is exactly this multi-line string, with an optional trailing newline:

   r                       t
  /                         \
 :                           :
 /    ,##.           ,##.    \
|     q##p           q##p     |
|      **             **      |
 \                           /
 :                           :
  \                         /
   L      ##########       j

Output

Your output is exactly this multi-line string, again with an optional trailing newline:

   r                                         t
  /                                           \
 :               ______             ______     :
 /              |######|           |######|    \
|     _______   |######|           |######|     |
|     #""""""   |######|           |######|     |
 \    #         |######|           |######|    /
 :    "          """"""             """"""     :
  \                                           /
   L                    ##########           j

Note that there are no trailing spaces in the input and output.

Rules and scoring

You can write a full program or a function.
The lowest byte count wins, and standard loopholes are disallowed.

Retina, 210 161 156 133 bytes (ISO 8859-1 encoding)

Completely remade, doesn't care about input anymore.

s`.+
3r41t¶2/43\¶1:15,13,5:¶1/10 e\¶|5_,e |¶|5#'e |¶1\4#5 e/¶1:4"10'13'5:¶2\43/¶3L19 10$*#11j
e
3~11~4
~
|6$*#|
,
6$*_
'
6$*"
\d+
$*

There is a trailing space at the end of last line. Also, a trailing newline is included in the output. If you want to suppress it, change the second last line to \`\d+

Old version, which uses parts of input in output:

( {3})(.+¶){3}.{10}( +)\S+( +).¶.( +)(.+¶){5}.+?(#+).+
$1rq te /q$1\e:pf,p$1,f:e/p$4~$3~$4\¶|f,_$1~$3~f|¶|f#'$1~$3~f|e\$4#$4f~$3~$4/e:$4"p'p$1'f:e \q$1/¶$1Lpp$7$3j
~
|6$*#|
,
6$*_
'
6$*"
q
pppp
p
ff
e
¶
f
5$*

Try it online! (210-byte version)
Try it online! (161-byte version)
Try it online! (156-byte version)
Try it online! (133-byte version)


Approximate the Score of a 2048 Game A game of 2048 goes like this:

Every move you get another piece - either 2 90% of the time, or 4 10% of the time
for each 2 equal pieces combined you get a piece of the sum of the two and the sum gets added to your score

Your task

given a board of a 4x4 game, give the average score of what A game like that would result in.

To calculate it, go the other way around of the game. For example, if there's an 8 piece, it's made from 4s. The average score of a 4 piece is 4*90% (90% of the time it's made from combining two 2 pieces together and it the other 10% a 4 isn't made, but ) = 3.6. As to make an 8 you need two 4s, and then you need to combine them to an 8, the result is 3.6*2 + 8 = 15.2.

In pseudocode a calculation for one number could be this:

function value (x) {
  if (x > 4) return value(x / 2) * 2 + x
  else if (x == 4) return 4*90%
  else return 0
}

but you're free to choose any approach as long as it works the same.

Clarifications

The input board will always be from a 4x4 board.
You can take in the board as an array of the 16 values, as 16 different inputs or even a 2D array if that somehow helps you.
The input numbers will always be zero or 2 to the power of a positive integer.
You can discard any errors due to floating point operations (but theoretically the program must implement a correct algorithm).
This is code-golf, the shortest code wins!

Test-cases

[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] -> 0
[2,4,2,4,4,2,4,2,2,4,2,4,4,2,4,2] -> 28.8
[4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4] -> 57.6
[0,0,0,4,0,0,0,8,0,0,0,16,2,2,0,2048] -> 20340.4
[2,16,2048,4096,4,32,1024,8192,8,64,512,16384,16,128,256,32768] -> 845465.2
[8,8,4,4,0,0,0,0,0,0,2,2,2048,65536] -> 996799.2

Python 3, 51 48 bytes

 -3 bytes thanks to Mr. Xcoder!

lambda b:sum(n*max(0,len(bin(n))-4.1)for n in b)

Try it online!


Decimal Digit Truncating Input:
A decimal
Output:
The input truncated
How to truncate them?
The integer part of the input will remain the same. The decimal part of the input will be truncated based on the lowest digit in consecutive order. The two step-by-step examples below should clarify what I mean by that:
Example 1: Input: 17.46940822
Step 1: Leave the integer part unchanged: 17
Step 2: Look at the first decimal digit, and truncate it to that many decimal digits: 4 → .4694
Step 3: Look at the next decimal digit. If it's lower, adjust the truncation accordingly. If not, continue to the next decimal digit: 6 → remains .4694
Step 3 again: 9 → remains .4694
Step 3 again: 4 → remains .4694
So the output will be: 17.4694.
Example 2: Input: 10.4521084
Step 1: Leave the integer part unchanged: 10
Step 2: Look at the first decimal digit, and truncate it to that many decimal digits: 4 → .4521
Step 3: Look at the next decimal digit. If it's lower, adjust the truncation accordingly. If not, continue to the next decimal digit: 5 → remains .4521
Step 3 again: 2 → truncation adjusted to: .45
So the output will be: 10.45
Challenge rules:

You are allowed to take the input as decimal, string, list/array/stream of characters, etc. (Same applies to the output, although I doubt there are a lot of languages that have the proper truncation while remain working with decimal values.)
You are also allowed to use a comma , instead of a dot . (perhaps useful for regex-based solution/languages).
If the decimal part is not long enough for the truncation, you are optionally allowed to add trailing zeros. I.e. 123.4 can be both 123.4 or 123.4000
If you have to truncate to 0 decimal digits we omit the decimal digits. The dot/comma may remain optionally if you use strings. I.e. 847.3072 → 847 (or 847.)
You can assume the input will always contain at least one decimal digit, so 123 won't be an input, but 123.0 can be an input.

General rules:

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

Test cases:
Input:          Output:

17.46940822     17.4694
10.4521084      10.45
123.4           123.4000 (or 123.4)
-847.3072       -847 (or -847.)
123.0           123 (or 123.)
98.76543210     98.7654
0.3165          0.3
-0.1365         -0.1
82937.82937     82937.82
-0.1010101      -0.1
-1.0101010      -1 (or -1.)
28.684297       28.68
13.35           13.350 (or 13.35)
0.99999999999   0.999999999
28.321          28.32
0.56462         0.5646

Python 2, 103 101 98 94 93 87 bytes

a,b=input().split('.');i,w=0,len(b)
while w>i:w=min(int(b[i]),w);i+=1
print a+'.'+b[:w]

Try it online!

Saved:

-2 bytes, thanks to Kevin Cruijssen
-3 bytes, thanks to Vedant Kandoi
-4 bytes, thanks to Lynn


Translate Morse code based on tone duration Goal

Morse code is often represented as sound.  Given a stream of bits that represent whether sound is on or off, translate the stream into letters and numbers and spaces.

Specifics

The bit stream is analysed based on the length of repeating ON/OFF bits.

1 ON bit is a dot
3 ON bits are a dash
1 OFF bit delimits dots and dashes
3 OFF bits delimits characters
7 OFF bits delimits words (space)

The input may be a string or array.  Only two unique characters/values of your choice are allowed in the input.  (eg. 0/1, true/false, comma/space)
The output returns a string or is printed to the standard output.

Example

Input:    101010100010001011101010001011101010001110111011100000001011101110001110111011100010111010001011101010001110101
Analysis: \--H--/   E   \---L---/   \---L---/   \----O----/\-- --/\---W---/   \----O----/   \--R--/   \---L---/   \--D--/
Output:   HELLO WORLD

Assumptions

The stream always starts and ends with an ON bit.
There is no leading or trailing whitespace.
The input is always valid.
All letters (case-insensitive) and digits are supported.

Test Cases

101010100010001011101010001011101010001110111011100000001011101110001110111011100010111010001011101010001110101
HELLO WORLD

10100000001011100011101110000000101110000000101011101000101000101010001010101
I AM A FISH

1010111011101110001110111011101110111000101110111011101110001110111010101
2017

101010001110111011100010101
SOS

Scoring

This is code golf.  The lowest byte-count code by this time next week wins.

APL (Dyalog), 65 62 60 57 bytes

-3 thanks to ngn.

Tacit prefix function.

⎕CY'dfns'
morse'/|[-.]+'⎕S'&'∘(⊃∘'/. -'¨6|'1+|(00)+'⎕S 1)

Try it online! Header, f←, and Footer are just to allow calling the function from Input while retaining TIO's byte count. In a normal APL session (corresponding to TIO's Input field), it would not be needed.

⎕CY'dfns' copy the dfns workspace (library)

(…) apply this tacit function:
 '1+|(00)+'⎕S 1 PCRE Search 1-runs and even-length 0-runs and return matches' lengths
 6| division remainder when divided by 6
 ⊃∘'/. -'¨ for each match length, pick the corresponding character from this string
'/|[-.]+'⎕S'&'∘ PCRE Search slashes and dash/dot-runs and return those
morse translate from Morse code to regular text


Build a half cardinal cyclic quine A half cardinal cyclic quine is a cyclic quine with two states, one perpendicular to the other.

Rules

You can decide which rotation you want to implement, clockwise or counter-clockwise.

Once rotated, any gaps in your code should be replaced with spaces to preserve the positioning.

Your program must satisfy the community definition of a quine.

This is code-golf so the shortest program in each language wins. Your first program is used for your byte count.

Standard loopholes are forbidden.

Examples

If your program is:

$_='print';eval

Then the next iteration must be either:

$
_
=
'
p
r
i
n
t
'
;
e
v
a
l

or

l
a
v
e
;
'
t
n
i
r
p
'
=
_
$

which must output the original program:

$_='print';eval

If your program is:

;$_=';
;$_=';
print

Then the next iteration must be either:

;;
''t
==n
__i
$$r
;;p

or:

p;;
r$$
i__
n==
t''
 ;;

which must output the original program:

;$_=';
;$_=';
print

CJam, 19 17 15 bytes

{s"_~"+N*""-}_~

Try it online! Try the rotation.

Explanation

{s"_~"+  e# Standard quine framework. Puts a string representation of the entire
         e# program on the stack.
  N*     e# Riffle linefeeds into the string, which is effectively a clockwise
         e# rotation by 90°.
  ""-    e# Does nothing.
}_~

In the rotated code, we've got linefeeds everywhere:

{
s
"
_
~
"
+
N
*
"
"
-
}
_
~

As Lynn noticed on Dom's earlier quine challenge inserting linefeeds actually still forms valid quine, because the linefeeds inside the block will just be retained verbatim anyway, and there will also be linefeeds in the "_~" string to make those two characters at the end show up on their own line. So {s"_~"+...}_~ (with linefeeds) is still a valid quine framework (although there'll be an additional linefeed at the end of the string). N* now inserts even more linefeeds into that string, but we don't really care: because now ""- has a linefeed inside that string so it actually removes all linefeeds from the program representation. So we end up with the horizontal form of the code again, undoing the rotation.


Write a program that uses all printable non-alphanumeric ASCII symbols In particular, use each of these symbols at least once in your source code:

! " # $ % & ' () * + , - .  / : ; < = > ? @ [ \ ] ^ _ ` { | } ~

Symbols inside comments, string literals, regexps (or any other kinds of literals etc.) don't count (but their delimiters such as /**/ or "" do count).

The program should not perform any action. It just has to compile and do nothing when run.

If for some reason some of the symbols cannot be used in the language of your choice, explain that rigorously (what and why must be excluded).

Update: A few answers used symbols withing regular expressions. I'd consider this a bit problematic, it's the same thing as putting them into string literals or comments (that's why I put etc. in that requirement). Please try without this. I also updated the requirement above.

Update: Shortest code wins (tagged as code-golf). As suggested, we'll most likely need some tie-breaker criteria. I suggest that if there is a tie, the winning one is the one in which the ASCII symbols appear as much ordered as possible. Formally: Filter out the first occurrence of each of the listed symbols from a program. This will result in a permutation on the listed symbols. The program with less inversion number of its permutation wins.

Update: I'd be happy to see some/more solutions in regular/mainstream languages, such as C(++), Java, Scala, Haskell, etc.

Perl, 32 chars

no hiding symbols in comments, string literals, or regular expressions. uses all symbols precisely once.

$`<@"^[(\{_},)]/+-~%'?&|:!*.=>;#

Description

i have tried to indicate operator precedence with indentation: the right-most expressions are evaluated before those to their left

        $`            # scalar variable $ named `
      <               # numeric less-than inequality <
        @"            # array variable @ named "
                      #   (array evaluated in scalar context)
    ^                 # bitwise XOR ^
        [(\{_},)]     # array reference []
                      #   containing array ()
                      #     containing reference \
                      #       to anonymous hash reference {}
                      #         with one key "_"
                      #           and no value (nothing following comma ,)
                      #             (reference evaluated in scalar context)
      /               # numeric division /
        +-~%'         # unary addition +
                      #   and unary negation -
                      #     and bitwise complement ~
                      #       on hash variable % named '
                      #         (hash evaluated in scalar context)
  ?                   # ternary conditional operator ?:
    &|                # code reference variable & named |
  :                   # ternary conditional operator ?:
    ! *.              # logical negation !
                      #   on typeglob variable * named .
                      #     (typeglob evaluated in scalar context)
  =>                  # fat comma => for compound expression
                      #   (evaluates LHS as string, RHS is empty)
;                     # end of expression ;
#                     # start of comment #


An ogl-edocf challenge Input
A non-empty shuffled string consisting of ASCII characters in the range \$[32..126]\$.
Output
The output is obtained by applying successive rotations to the input string.
For each letter ([a-zA-Z]) in the input string, going from left to right:

if the letter is in upper case, rotate all characters before it by one position to the left
if the letter is in lower case, rotate all characters before it by one position to the right

Example
Input: "Cb-Ad"

The first letter is a "C". We should do a rotation to the left, but there's no character before this "C". So, there's nothing to rotate.
The next letter is a "b". We rotate "C" to the right. Because it's a single character, it is left unchanged.
The character "-" does not trigger any rotation, as it's not a letter.
The next letter is a "A". We rotate "Cb-" to the left, which gives "b-CAd"
The fourth and last letter is a "d". We rotate "b-CA" to the right, which gives "Ab-Cd"

Therefore, the expected output is "Ab-Cd".
Rules

You may take input as a string or as an array of characters -- which may or may not be the same thing, depending on your language.
You may also output an array of characters instead of a string.
This is ogl-edocf code-golf

Test cases
"cbad" -> "abcd"
"ACBD" -> "ABCD"
"Cb-Ad" -> "Ab-Cd"
"caeBDF" -> "aBcDeF"
"aEcbDF" -> "abcDEF"
"ogl-edocf" -> "code-golf"
"W o,ollelrHd!" -> "Hello, World!"
"ti HIs SSta ET!" -> "tHis IS a tEST!"

Pyth, 21 20 bytes

VQ=k+.>k-}NG}Nr1GN)k

Try it here

Explanation

VQ=k+.>k-}NG}Nr1GN)k
VQ                )      For each N in the input...
     .>k                 ... rotate k (initially '')...
        -}NG}Nr1G        ... by (N is lowercase) - (N is uppercase)...
    +            N       ... then append N...
  =k                     ... and update k.
                   k     Output the result.


Self-Validating Triangular Checkerboard Program A checkerboard program is a program where each individual character's ordinal value alternates from even to odd, excluding the line terminator (which can be any standard line-endings).

A triangular program is a program where each line has one additional character than the preceding line, with the first line having one character. You do not need to handle empty input.

Your task is to build a program that validates that the given input adheres to those criteria and outputs/returns something truthy if the program meets the criteria, or something falsy otherwise.

Your program must also meet these criteria.

Examples of valid programs

G
`e
@u^
5r{B

^
cB
+$C
VA01

Rules

Your program may start with either an odd or an even byte as long as the parity of the characters alternates.
Your program must validate programs that start with either an odd or an even character.
For unicode characters, the underlying byte values must have alternating parity.
You can assume that input only contains printable characters. If your program contains unprintables, it should still be able to validate itself.
Your program may include one trailing newline, this does not need to be allowed by your validation as you can assume this is removed prior to validating.
Standard loopholes are forbidden.
The shortest code in bytes, in each language, wins.

C (gcc), 189 bytes

j
;l
;b;
d;f␉
(char
␉*␉t)
{b=*␉t%
2;for␉(␉
j=d=0;j=j
+ 1,␉l=j+
1,␉*␉t; ) {
for␉(;l=l- 1
 ;t=t+ 1 )b=
!b␉,␉d=d+ !(␉*
␉t␉*␉(␉*␉t- 10)
*␉(␉*␉t%2-b) ) ;
d␉|=*␉t- 10;t=t+
1 ; }b= !d; } ␉ ␉

Try it online!

␉ represents a tab character (I'm sorry). Note that there are several trailing spaces/tabs (I'm more sorry). The original with tabs intact is best viewed in vim with :set tabstop=1 (words cannot express how sorry I am).

It's a function (called f, which isn't immediately obvious from glancing at it) that takes a string as an argument and returns either 0 or 1.

I could reduce this by at least one and probably two or more lines, but note that it gets increasingly messy and low-effort towards the end, mostly because writing such awful code (even by PPCG  standards) was making me feel like a bad person and I wanted to stop as soon as possible.

The basic idea here is to avoid constructions that necessarily break the format (++, +=, return, etc.). Miraculously, important keywords like for, char, and while (which I didn't end up using) happen to fit the alternating parity rule. Then I used spaces (even parity) and tabs (odd parity) as padding to make the rest fit the rules.


Evaluate the Riemann Zeta Function at a Complex Number Introduction
I found this question that was closed because it was unclear, yet it was a nice idea. I'll do my best to make this into a clear challenge.
The Riemann Zeta function is a special function that is defined as the analytical continuation of

to the complex plane. There are many equivalent formulas for it which makes it interesting for code golf.
Challenge
Write a program that takes 2 floats as input (the real and imaginary part of a complex number) and evaluates the Riemann Zeta function at that point.
Rules

Input and output via console OR function input and return value
Built in complex numbers are not allowed, use floats (number, double, ...)
No mathematical functions except + - * / pow log and real valued trig functions (if you want to integrate, use the gamma function, ... you must include this functions definition in the code)
Input: 2 floats
Output: 2 floats
Your code must contain value that gives theoretically arbitrary precision when made arbitrary large/small
The behaviour at input 1 is not important (this is the only pole of this function)

Shortest code in bytes wins!
Example Input and Output
Input:

2, 0

Output:

1.6449340668482266, 0

Input:

1, 1

Output:

0.5821580597520037, -0.9268485643308071

Input:

-1, 0

Output:

-0.08333333333333559, 0

Python - 385

This is a straightforward implementation of Equation 21 from http://mathworld.wolfram.com/RiemannZetaFunction.html This uses Python's convention for optional arguments; if you want to specify a precision, you can pass a third argument to the function, otherwise it uses 1e-24 by default.

import numpy as N
def z(r,i,E=1e-24):
 R=0;I=0;n=0;
 while(True):
  a=0;b=0;m=2**(-n-1)
  for k in range(0,n+1):
   M=(-1)**k*N.product([x/(x-(n-k))for x in range(n-k+1,n+1)]);A=(k+1)**-r;t=-i*N.log(k+1);a+=M*A*N.cos(t);b+=M*A*N.sin(t)
  a*=m;b*=m;R+=a;I+=b;n+=1
  if a*a+b*b<E:break
 A=2**(1-r);t=-i*N.log(2);a=1-A*N.cos(t);b=-A*N.sin(t);d=a*a+b*b;a=a/d;b=-b/d
 print(R*a-I*b,R*b+I*a)


Shortest program that demonstrates a language's complete syntax The Challenge

Write the shortest possible program that demonstrates a programming language's entire syntax: statements, expressions, operators, reserved words, etc.

Take the language's grammar (usually in EBNF) and create a program that uses all of it.

The program doesn't have to do anything particularly useful, but if it does that's a bonus :)

Rules

You must use all of the language's syntax: every type of statement, expression, operator, keyword, etc the language defines.
It must be able to be run with no dependencies, except for the standard library included with the language (it doesn't need to use the entire standard lib though).
Include a link to the language spec you used (e.g. here is the Python 2.7 grammar).

Jot (2 chars)

10

http://semarch.linguistics.fas.nyu.edu/barker/Iota/#Goedel


Fizz Buzz.. Crackle Pop! (Generalized Fizz Buzz) We've all heard of the ol' Fizz Buzz problem, but what happens when you try to apply it with more factors? Fizz Buzz Crackle Pop!
The Challenge
Write a full program that takes an integer input n, then n tuples containing an integer and a string, then another integer (>1) k, as such:
 n int1 str1 int2 str2 (...) intn strn k

You can take this line from either command line or STDIN.
Then, for all integers 1 to k, if it is divisible by any of int1, int2...intn, output all corresponding strs in the input order, followed by a newline. If it isn't, then just output the integer, followed by a newline.
For example, with input
3 2 Fizz 3 Buzz 5 Crackle 10

we get
1
Fizz
Buzz
Fizz
Crackle
FizzBuzz
7
Fizz
Buzz
FizzCrackle

But with input (notice the order change)
3 3 Buzz 2 Fizz 5 Crackle 10

we get
1
Fizz
Buzz
Fizz
Crackle
BuzzFizz
7
Fizz
Buzz
FizzCrackle

Optional trailing newline is acceptable.
Shortest code in bytes wins.
Edits:
Obviously I've missed out a lot, sorry.

Inputs from console and STDIN, anything else gets +5 bytes (:c) anywhere
Full programs please.
Assume non-empty strings for strs
No guarantees for uniqueness of ints

Sample C++ program (limited at 20 because I'm lazy):
#include <iostream>
#include <string>
using namespace std;

int main() {
  string names[20];
  int mods[20], n, max;
  cin >> max >> n;
  for (int i=0; i<n; i++) {
    cin >> mods[i] >> names[i];
  }
  for (int i=1; i<=max; i++) {
    bool found = false;

    for (int j=0; j<n; j++) {
      if (i % mods[j] == 0) {
        found = true;
        cout << names[j];
      }
    }
    if (!found)
     cout << i;
    cout << endl;
  }

  return 0;
}


Write a square-counting program A well-known puzzle involves counting how many squares can be made using the points on a 3x3 grid:

.  .  .
.  .  .
.  .  .

The answer is 6 — four small squares, one large square, and one square formed from the top, left, bottom, and right pegs, with edges along the diagonals of the squares.

Your task is to build a program that counts the total number of squares that can be formed from a set of points.

Your program will take input in one of two formats (of your choosing):

An M by N grid  consisting of either . or . . represents a point on the grid that a square can be a corner of, and all spaces on the grid are exactly one unit apart horizontally or vertically.
A list of coordinate pairs representing points that a square can be on.

and return the number of distinct squares that can be formed using the points provided. Your program must return a correct solution for every possible input.

For example, take the input above but where the center square is missing:

...
. .
...

There are only two possible squares here (the big one and the diagonal one), so the program should return 2.

The shortest code to do this in any language wins.

Python, 95

Takes a list of coordinates from stdin.

l=input();print(sum((c-d+b,d+c-a)in l and(a-d+b,b+c-a)in l for a,b in l for c,d in l)-len(l))/4

Explanation:

   For each pair of points (a,b) and (c,d), check if the square with additional points (c-d+b,d+c-a) and (a-d+b,b+c-a) is in the list.  This counts each square 4 times, and each point once (when (a,b) = (c,d)), so subtracting the number of points and dividing by 4 gives the number of squares.


Alternating Triangles Given a strictly positive integer n (therefore 0 isn't a valid test case), produce an approximate triangle of height n.

A non-programmatic process of drawing the picture

Initially we start with the base of the triangle.

|

So, we want to draw a triangle of a height of 5. First we know that all the |'s align on a straight line, and there is a missing | on every even position.

|

|

|

Then, we insert the /'s onto these empty lines, where every / has 1 more preceding space than the next /. The lowest / starts at 1 space.

|
  /
|
 /
|

More reference outputs + Sample program

Here's what the program should output for inputs 1 to 9. A sample program is available if you still don't understand the specification.

For those that don't see that it's a triangle: Take a look at this. Scroll the picture really quickly. You will see the two sides of a triangle.

==== 1: ====
|
==== 2: ====
 /
|
==== 3: ====
|
 /
|
==== 4: ====
  /
|
 /
|
==== 5: ====
|
  /
|
 /
|
==== 6: ====
   /
|
  /
|
 /
|
==== 7: ====
|
   /
|
  /
|
 /
|
==== 8: ====
    /
|
   /
|
  /
|
 /
|
==== 9: ====
|
    /
|
   /
|
  /
|
 /
|

Specification

Leading/Trailing whitespace is allowed.
The string has to be joined with newlines, outputting a string list is not allowed.

Husk, 12 bytes

↔↑ṁe"|"¡Θ" /

Try it online!

Builds the infinite triangle upside-down, then takes the required number of lines and reverses them before printing.

Explanation

↔↑ṁe"|"¡Θ" /
       ¡        Repeat and accumulate results:
        Θ          prepend a space
         " /       starting from the string " /"
                   (this will create all the lines of the slanted side)
  ṁ             For each line:
   e"|"            put it in a list with a "|" line
  ṁ             and merge all these lists together
 ↑              Take the number of lines required by the input
↔               Reverse the result


Print every printable ASCII character without using it In a programming language of your choice, write 95 programs, each of which outputs a different one of the 95 printable ASCII characters without that character occurring anywhere in the program.
For example, if your language was Python, your program that outputs the character P might be
print(chr(80))

because P has ASCII code 80. This program is valid because P never appears in the source code. However, for the program that outputs lowercase p, something like
print(chr(112))

would be invalid because, while it does print p, p is present in the code. A valid program could be
exec(chr(112)+'rint(chr(112))')

which prints p but does not contain p.
Your goal is to make each of your 95 programs as short as possible. Your score is the sum of the character lengths of all your programs.
If for any reason you are unable to write valid programs for some characters, you may mark those characters as "Did Not Program" or DNP, and omit programs for them entirely. This way syntactically strict languages will be able to compete.
The winning answer is the answer that has the lowest score of the set of answers that have the fewest DNP's.
Rules

The source code of all of your programs may only contain printable ASCII plus tabs and newlines, all of which are counted as one character. (Because in a different encoding it would be easy to omit characters that don't exist!)

Note: This rule seems necessary but there are many languages with different encodings and I'm sure it'd be cool to see the answers for them. Therefore you can break this rule, you can use whatever characters you want, but then your answer becomes non-competitive, it cannot win.

The programs must be actual, full programs, according to your language's standard conventions. Functions and REPL snippets are not allowed.

Each program's output should go to stdout or your language's accepted alternative.

Programs should not prompt for or require input. (If prompting for input is inherent to your language, that's ok.)

Programs should be deterministic, finite in run time, and independent. e.g. it shouldn't matter if one is run in a folder separate from the other programs.

A program's output should be the precise printable ASCII character it corresponds to, optionally followed by a single trailing newline, nothing more, nothing less.

Be sure to include information on all 95 (ideally) programs in your answer, as well as your score and any DNP's. You don't have to list all programs that follow a simple pattern like "print(chr(80)), print(chr(81)), print(chr(82))..." but make sure you're sure they all would work and that your score is added correctly.
For reference, here are the 95 printable ASCII your programs must output:
 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~

Python 2, 1075 1065 1043 1040 1039 bytes

Each program has the form print'\<octal char code>', except:

' → print"\47"
0 through 8 → print~-<N+1>
9 → print-~8
\ → print'%c'%92
i → exec'pr\151nt"\151"'
n → exec'pri\156t"\156"'
p → exec'\160rint"\160"'
r → exec'p\162int"\162"'
t → exec'prin\164"\164"'

For reference and ease of testing, here's the full list of programs, newline-separated.

print'\40'
print'\41'
print'\42'
print'\43'
print'\44'
print'\45'
print'\46'
print"\47"
print'\50'
print'\51'
print'\52'
print'\53'
print'\54'
print'\55'
print'\56'
print'\57'
print~-1
print~-2
print~-3
print~-4
print~-5
print~-6
print~-7
print~-8
print~-9
print-~8
print'\72'
print'\73'
print'\74'
print'\75'
print'\76'
print'\77'
print'\100'
print'\101'
print'\102'
print'\103'
print'\104'
print'\105'
print'\106'
print'\107'
print'\110'
print'\111'
print'\112'
print'\113'
print'\114'
print'\115'
print'\116'
print'\117'
print'\120'
print'\121'
print'\122'
print'\123'
print'\124'
print'\125'
print'\126'
print'\127'
print'\130'
print'\131'
print'\132'
print'\133'
print'%c'%92
print'\135'
print'\136'
print'\137'
print'\140'
print'\141'
print'\142'
print'\143'
print'\144'
print'\145'
print'\146'
print'\147'
print'\150'
exec'pr\151nt"\151"'
print'\152'
print'\153'
print'\154'
print'\155'
exec'pri\156t"\156"'
print'\157'
exec'\160rint"\160"'
print'\161'
exec'p\162int"\162"'
print'\163'
exec'prin\164"\164"'
print'\165'
print'\166'
print'\167'
print'\170'
print'\171'
print'\172'
print'\173'
print'\174'
print'\175'
print'\176'

To test:

$ python printables.py | sed ':a;N;$!ba;s/\n//g'
 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~

-1 bytes thanks to @Sp3000!


"Hello, World!" (Every other character, Part 2) As a kind of part 2 to Hello, World! (Every other character), write a program such that all three of these programs print "Hello, World!": the entire program, the 1st, 3rd, 5th, etc. characters of your program, and the 2nd, 4th, 6th, etc.

If your program is:

abc
def

It should output "Hello, World!", but so should

acdf

And

b
e

No solutions with built-in "Hello, World!"s.

x86 machine code, 378 bytes

PROG.COM Download and run it in MS-DOS emulator, DOSBox for example.

B3 B4 B3 02 90 B3 B3 B4 02 B3 B4 B3 02 90 B3 B2
B3 48 90 B3 B3 B2 48 B3 B2 B3 48 90 B3 CD B3 21
90 B3 B3 CD 21 B3 CD B3 21 90 B3 B2 B3 65 90 B3
B3 B2 65 B3 B2 B3 65 90 B3 CD B3 21 90 B3 B3 CD
21 B3 CD B3 21 90 B3 B2 B3 6C 90 B3 B3 B2 6C B3
B2 B3 6C 90 B3 CD B3 21 90 B3 B3 CD 21 B3 CD B3
21 90 B3 CD B3 21 90 B3 B3 CD 21 B3 CD B3 21 90
B3 B2 B3 6F 90 B3 B3 B2 6F B3 B2 B3 6F 90 B3 CD
B3 21 90 B3 B3 CD 21 B3 CD B3 21 90 B3 B2 B3 2C
90 B3 B3 B2 2C B3 B2 B3 2C 90 B3 CD B3 21 90 B3
B3 CD 21 B3 CD B3 21 90 B3 B2 B3 20 90 B3 B3 B2
20 B3 B2 B3 20 90 B3 CD B3 21 90 B3 B3 CD 21 B3
CD B3 21 90 B3 B2 B3 77 90 B3 B3 B2 77 B3 B2 B3
77 90 B3 CD B3 21 90 B3 B3 CD 21 B3 CD B3 21 90
B3 B2 B3 6F 90 B3 B3 B2 6F B3 B2 B3 6F 90 B3 CD
B3 21 90 B3 B3 CD 21 B3 CD B3 21 90 B3 B2 B3 72
90 B3 B3 B2 72 B3 B2 B3 72 90 B3 CD B3 21 90 B3
B3 CD 21 B3 CD B3 21 90 B3 B2 B3 6C 90 B3 B3 B2
6C B3 B2 B3 6C 90 B3 CD B3 21 90 B3 B3 CD 21 B3
CD B3 21 90 B3 B2 B3 64 90 B3 B3 B2 64 B3 B2 B3
64 90 B3 CD B3 21 90 B3 B3 CD 21 B3 CD B3 21 90
B3 B2 B3 21 90 B3 B3 B2 21 B3 B2 B3 21 90 B3 CD
B3 21 90 B3 B3 CD 21 B3 CD B3 21 90 B3 CD B3 20
90 B3 B3 CD 20 B3 CD B3 20 90

Also you can download LEFT.COM and RIGHT.COM

How it works and how to run

See answer to part one

Magic

If you want to execute 0xAB opcode command with one parameter 0xCD, you write

Generator

Run code, get hex. Convert in to binary

cat prog.hex | xxd -r -p > PROG.COM

function byte2hex(byte){
 var ret=byte.toString(16).toUpperCase();
 return ret.length==1 ? "0"+ret : ret;
}

function str2hex(str){
 var ret = [];
 for(var i=0;i<str.length;i++){
  ret.push(byte2hex(str.charCodeAt(i)));
 }
 return ret;
}

function genCode(hexArr){
 var ret = [["B4","02"]];
 for(var i=0;i<hexArr.length;i++){
  if(hexArr[i]!=hexArr[i-1]){
   ret.push(["B2",hexArr[i]]);
  }
  ret.push(["CD","21"]);
 }
 ret.push(["CD","20"]);

 return ret;
}

function format(arr){
 var ret=[],tmp=[];
 for(var i=0;i<arr.length;i++){
  tmp.push(arr[i]);
  if(i%16==15 || i==arr.length-1){ret.push(tmp.join(" "));tmp=[];}
 }
 return ret.join("\n");
}

function magicCode(str,mode){
 var ret=[];
 var code=genCode(str2hex(str));

 for(var i=0;i<code.length;i++){
  var ab=code[i][0],cd=code[i][1],tmp;
  tmp=["B3",ab,"B3",cd,"90","B3","B3",ab,cd,"B3",ab,"B3",cd,"90"];
  for(var j=0;j<tmp.length;j++){
   if((mode&1 && j%2==0) || (mode&2 && j%2==1)){ret.push(tmp[j])}
  }

 }
 return ret;
}

const LEFT=1,RIGHT=2,ALL=3;

var str=prompt("string","Hello, world!");

var out = ["PROG.COM\n",format(magicCode(str,ALL)),"\n\nLEFT.COM\n",format(magicCode(str,LEFT)),"\n\nRIGHT.COM\n",format(magicCode(str,RIGHT))].join("\n");

document.write(out.replace(/\n/ig,"<br>"));


Reach the number in minimum steps In this challenge, you are given a number x. You have to find the minimum number of steps required to reach x from 1. At a particular point, you have two choices:

1) Increment the number by 1.

2) Reverse the integer (remove leading zeros after reversing)

Input: n=42
Output: 1>2>3>4>5>6>7>8>9>10>11>12>13>14>41>42 **(15 steps)**

The minimum steps to reach 42 from 1 is 15. This can be achieved if we increment numbers by 1 from 1 to 14 (13 steps). After reaching 14 we can reverse the number which will give us 41 (1 step). From 41 we can increment number by 1 to reach 42(1 step). Hence the total number is 15 steps, which is then the minimum.

Note that if we reverse the number after reaching 12 or 13, we will not get the minimum steps.

1>2>3>4>5>6>7>8>9>10>11>12>21>22>23>32>33>34>35>36>37>38>39>40>41>42 (25 steps)

Input: n=16
Output: 1>2>3>4>5>6>7>8>9>10>11>12>13>14>15>16 **(15 steps)**

In this case we have to increment the numbers until we get 16, which will give us a minimum of 15 steps.

Note:  Starting from 0 is also allowed, which will increase all output by 1.

Haskell, 82 73 bytes

r=read.reverse.show
f 1=0
f a=1+(minimum$f(a-1):[f$r a|r a<a,mod a 10>0])

Try it online!

Simplest recursion method.

-9 bytes thanks to Christian Sievers


Interleaving reversing Given a string, reverse it interleavingly. Here's how to do it for abcdefghi and abcdefghij, 0-indexed:

Separate the chars at even indices from the chars at odd indices:a c e g i
 b d f h
a c e g i
 b d f h j
Reverse the chars at odd indices:a c e g i
 h f d b
a c e g i
 j h f d b
Interleave into one string again:ahcfedgbi
ajchefgdib

Rules

You must support both even-length and odd-length strings.
0-index-wise, you must reverse the chars at odd indices, not even.
1-index-wise, of course, you must reverse the chars at even indices, not odd.
Input will consist of printable ASCII (code points 32-126), no newlines.
You can take input either as a string or as a list of chars (NOT 1-char strings). E.g. String/char[] or char* are allowed, but String[]/char[][] or char** aren't.

Test cases

Input
Output

Hello, World!
HdlroW ,olle!

Hello World!
H!llooW rlde

ABCDEFGHIJKLMNOPQRSTUVWXYZ
AZCXEVGTIRKPMNOLQJSHUFWDYB

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
 }"{$y&w(u*s,q.o0m2k4i6g8e:c<a>_@]B[DYFWHUJSLQNOPMRKTIVGXEZC\A^?`=b;d9f7h5j3l1n/p-r+t)v'x%z#|!~

P
P

AB
AB

xyz
xyz

For the empty string, return the empty string itself.

MATL, 8 bytes
t2L)P5M(

Try it online! Or verify all test cases.
Explanation
t     % Implicit input. Duplicate
      % STACK: 'abcdefghi', 'abcdefghi'
2L    % Push [2, 2, 1j]. This represents 2:2:end when used as an index
      % STACK: 'abcdefghi', 'abcdefghi', [2, 2, 1j]
)     % Get entries at those indices
      % STACK: 'abcdefghi', 'bdfh'
P     % Flip
      % STACK: 'abcdefghi', 'hfdb'
5M    % Push [2, 2, 1j] again
      % STACK: 'abcdefghi', 'hfdb', [2, 2, 1j]
(     % Write entries at those indices. Implicit display
      % STACK: 'ahcfedgbi'