text:
The Chroma Key to Success
The RGB color value #00FF00 is a rather important one: it is used to make movies, TV shows, weather announcements, and more. It is the famous "TV green" or "green screen" color.
The Challenge
Your task is to write a program that takes two input images, both in PNG format (or in your image library's image object type) and of the same dimensions. One image can be any old image. The other one is the image that will have a background of the color #00FF00. The output image will consist of the second image overlaid over the first, with no #00FF00 color present (except in the first image). Input and output may be done with files, a GUI, etc. You are allowed to take an array of RGB values as input, as seen here. You may assume that an image has only pixels of full opacity.
Basically...
Make a program that takes every #00FF00 pixel in one image and replace it with the corresponding pixel in the background image.
Test Cases
Generously provided by @dzaima:
Background:

Foreground:

Output:

Of course, standard loopholes are strictly forbidden. This includes using an online resource to do it for you.
This is code-golf, so may the shortest code win and the best programmer prosper...

May we take an image object in the native format of the language/library as input, or do we have to read the image via filename?

@notjagan You may take image objects as input.

Can you add an example?

@ovs i need someone else to provide something

Is I/O of arrays of arrays of integers acceptable or are we actually restricted to some other set of image I/O?

Can we take the chroma-key (0x00ff00) as a function arg?  I'm assuming the constant has to be hard-coded into the function, but I could save bytes by having the caller put it in a register for me, making the function more flexible/generic.

@PeterCordes I will allow that.

@JonathanAllan Yes. Just explain the format used.

@ckjbgames: Are you sure that's a good idea?  Several existing answers could probably be smaller if they got the caller to put the colorkey into a variable in the form they want it (e.g. a list like [0,255,0]).  I'd actually recommend that you don't change the rules at this point, from what people were assuming.  Unless it's normal to allow that kind of thing for codegolf, and the other answers should have thought of that :P

@PeterCordes ok

@PeterCordes Done

Oh, I think you were misunderstanding what I was asking.  I was talking about the color value to match, not the array of image pixels.  I was asking about replacing the 0xff00 32-bit constant with a one-byte reference to an argument passed by the caller (which on second thought I decided would be a bad change, because it's basically cheating by offloading part of the function to the caller, even if you could justify it in a chromakey function).  Your edit to the question to allow taking images as arrays of pixels was good, but nothing to do with what I was talking about.

@PeterCordes Oh. Undo.

x86-64 (and x86-32) machine code, 13 15 13 bytes
changelog:

Bugfix: the first version was only checking G=0xff, not requiring R and B to be 0.  I changed to modifying the background in place so I could use lodsd on the foreground to have fg pixels in eax for the short-form cmp eax, imm32 encoding (5 bytes), instead of cmp dh,0xff (3 bytes).

Save 2 bytes: noticed that modifying the bg in place allowed using a memory operand for cmov, saving a 2-byte mov load (and saving a register, in case that matters).

This is a function following the x86-64 System V calling convention, callable directly from C or C++ (on x86-64 non-Windows systems) with this signature:
void chromakey_blend_RGB32(uint32_t *background /*rdi*/,
                     const uint32_t *foreground /*rsi*/,
                  int dummy, size_t pixel_count /*rcx*/);

The image format is RGB0 32bpp, with the green component at the 2nd lowest memory address within each pixel.  The foreground background image is modified in-place.  pixel_count is rows*columns.  It doesn't care about rows/columns; it just chromekey blends however many dwords of memory you specify.
RGBA (with A required to be 0xFF) would require using a different constant, but no change in function size.  Foreground DWORDs are compared for exact equality against an arbitrary 32-bit constant stored in 4 bytes, so any pixel-order or chroma-key colour can be easily supported.
The same machine code also works in 32-bit mode.  To assemble as 32-bit, change rdi to edi in the source.  All other registers that become 64-bit are implicit (lodsd/stosd, and loop), and the other explicit regs stay 32-bit.  But note that you'll need a wrapper to call from 32-bit C, because none of the standard x86-32 calling conventions use the same regs as x86-64 SysV.
NASM listing (machine-code + source), commented for asm beginners with descriptions of what the more complex instructions do.  (Duplicating the instruction reference manual is bad style in normal usage.)
 1                       ;; inputs:
 2                       ;; Background image pointed to by RDI, RGB0 format  (32bpp)
 3                       ;; Foreground image pointed to by RSI, RGBA or RGBx (32bpp)
 4          machine      ;; Pixel count in RCX
 5          code         global chromakey_blend_RGB32
 6          bytes        chromakey_blend_RGB32:
 7 address               .loop:                      ;do {
 8 00000000 AD               lodsd                   ; eax=[rsi], esi+=4. load fg++
 9 00000001 3D00FF0000       cmp    eax, 0x0000ff00  ; check for chromakey
10 00000006 0F4407           cmove  eax, [rdi]       ; eax = (fg==key) ? bg : fg
11 00000009 AB               stosd                   ; [rdi]=eax, edi+=4. store into bg++
12 0000000A E2F4             loop .loop              ;} while(--rcx)
13
14 0000000C C3               ret

##  next byte starts at 0x0D, function length is 0xD = 13 bytes

To get the original NASM source out of this listing, strip the leading 26 characters of each line with <chromakey.lst cut -b 26- > chromakey.asm.  I generated this with
nasm -felf64 chromakey-blend.asm -l /dev/stdout | cut -b -28,$((28+12))-
NASM listings leave more blank columns than I want between the machine-code and source.  To build an object file you can link with C or C++, use nasm -felf64 chromakey.asm.  (Or yasm -felf64 chromakey.asm).  To strip the addresses and line numbers as well, cut -b16-30,41- works well.
untested, but I'm pretty confident that the basic idea of load / load / cmov / store is sound, because it's so simple.
I could save 3 bytes if I could require the caller to pass the chroma-key constant (0x00ff00) as an extra arg, instead of hard-coding the constant into the function.  I don't think the usual rules allow writing a more generic function that has the caller set up constants for it.  But if it did, the 3rd arg (currently dummy) is passed in edx in the x86-64 SysV ABI.  Just change cmp eax, 0x0000ff00 (5B) to cmp eax, edx (2B).

With SSE4 or AVX, you might do this faster (but larger code size) with pcmpeqd and blendvps to do a 32-bit element size variable-blend controlled by the compare mask.  (With pand, you could ignore the high byte).  For packed RGB24, you might use pcmpeqb and then 2x pshufb+pand to get TRUE in bytes where all 3 components of that pixel match, then pblendvb.
(I know this is code-golf, but I did consider trying MMX before going with scalar integer.)

Could you send me an executable made with this machine code?

x86_32, please.

@ckjbgames: I haven't written a caller that loads / saves images, just the modify-pixels-in-place part.  I'd have to do that before it would make any sense to build an executable.  But if I did, what kind of executable?  Windows PE32?  Linux ELF32?  FreeBSD??

ELF32, if you will.

@ckjbgames: If I find time, I'll look for an image-loading library and write something.  I added a paragraph about how to turn the listing back into code you can assemble with nasm -felf32.  (For 32-bit, you'll also need a wrapper function to call from C, because it's still using the same registers as the x86-64 SysV ABI.)

Will you show me the wrapper function?

@ckjbgames: I haven't written one, but it would be very similar to the wrapper I made for my adler32 answer.  I put it on github, here's a link to that function.  I'd really recommend that you just assemble it as 64-bit and call it directly from C, because my function obeys the x86-64 SysV calling convention.

Mathematica 57 35 bytes
update: by default, a green background is removed using RemoveBackground.  The first submission included the unnecessary second parameter, `{"Background",Green}".

#~ImageCompose~RemoveBackground@#2&

Removes the background of image 2 and composes the result with image 1.

Example

The following, in prefix rather than infix form, shows more clearly how the code works.

Would this work for images where it's not the "background" that's green? (There seems to be a small patch of green left in your output)

If there were a green "island" in the picture, the additional parameter, `{"Background", Green}", would be required, which would raise the total to 57 bytes. That was my first submission.  Because I see no green isolated in the foreground of the picture, that parameter was dropped.

Python 3 + numpy, 59 bytes
lambda f,b:copyto(f,b,'no',f==[0,255,0])
from numpy import*

Try it online!
Input is given in the format of a numpy array, with integer triplets representing pixels (where #00FF00 in hex color code is equivalent to [0, 255, 0]). The input array is modified in place, which is allowed per meta.
Example Images
Input (from the question)
Background:

Foreground:

Foreground image after running the function:

Reference Implementation (uses opencv to read image files)
g = lambda f,b:copyto(f,b,'no',f==[0,255,0])
from numpy import*

import cv2

f = cv2.imread("fg.png")
b = cv2.imread("bg.png")

g(f, b)

cv2.imshow("Output", f)
cv2.imwrite("out.png", f)

Displays the image to the screen and writes it to an output file.

What's with all the red dots on the resulting image?

I've asked about I/O - this seems to comply with the current wording (i.e. "your library"), if so, does cv2 itself require the numpy import? If not you could do it in 54 by not using any numpy functions, and not importing numpy: lambda f,b:[x[list(x[0])==[0,255,0]]for x in zip(f,b)]. If list of lists of integers are actually acceptable too then you could do it in 48 with lambda f,b:[x[x[0]==[0,255,0]]for x in zip(f,b)]

..in fact even if numpy is required for cv2 to perform the conversion I still think you could do the 54 byte version, since we don't need to import cv2 for the challenge.

If  G == 255, the value gets replaced even if R and B are not zero which leads to the red dots. This also happens for the other bands even tough that's less visible. So it performs the logic checks independently of each other and swaps out single channels even if only one of the conditions is met. E.g. if a pixel is [0 255 37] the red and green bands will be replaced.

@LeanderMoesinger: Well spotted.  I had that bug in mine, too >.<; IDK why I thought that only checking green=0xFF while ignoring R and B was correct!

Processing, 116 99 bytes
PImage f(PImage b,PImage f){int i=0;for(int c:f.pixels){if(c!=#00FF00)b.pixels[i]=c;i++;}return b;}

Unfortunately, processing doesn't support java 8 stuff, like lambdas.
Example implementation: (saves image as out.png and also draws it on screen)
PImage bg;
void settings() {
  bg = loadImage("bg.png");
  size(bg.width,bg.height);
}
void setup() {
  image(f(bg, loadImage("fg.png")), 0, 0);
  save("out.png");
}
PImage f(PImage b,PImage f){int i=0;for(int c:f.pixels){if(c!=#00FF00)b.pixels[i]=c;i++;}return b;}

You can get rid of the settings() and setup() functions and just run the code directly.

@KevinWorkman I have settings and setup there so it'd display the image on screen, which otherwise wouldn't be possible

Is #ff00 or 0xff00 the same as #00ff00 in Processing?

@PeterCordes #FF00 gives syntax error, sadly, and #00FF00 == 0xFF00FF00, so 0xFF00 doesn't work as it checks for alpha value 0

@dzaima: Can you take your images in RGB0 format, so 0x0000FF00 is the bit-pattern you're looking for?

@PeterCordes I doubt that Processing would not modify it to be full opacity

In RGB0, the 4th byte is padding, not opacity.  It's just a padded RGB format without alpha.  (If Processing doesn't support it natively, though, then you'd have to accept your images as arrays of pixel data, instead of PImage, so that would be a somewhat different answer.)

Can int i=0;for(int c:f.pixels){if(c!=#00FF00)b.pixels[i]=c;i++;} be golfed into int i=0;for(int c:f.pixels)if(c!=#00FF00)b.pixels[i++]=c;?

@Cowsquack no, then i only gets incremented if c!=#00FF00, not always.

Bash + ImageMagick, 45 bytes
convert $1 $2 -transparent lime -composite x:

Takes two images as arguments and displays the output on the screen. Change x: to $3 to write to a third file argument instead. The method is simple: read the "background" image; read the "foreground" imagek; reinterpret the color "lime" (#00ff00) as transparency in the second image; then composite the second image onto the first and output.
ImageMagick: 28 bytes?
I could have submitted this as an ImageMagick answer but it's not clear how to deal with the arguments. If you want to posit that ImageMagick is a stack-based language (which is kinda sorta not really true but almost... it's weird) then -transparent lime -composite is a function that expects two images on the stack and leaves one merged image on the stack... maybe that's good enough to count?

MATL, 40 37 31 bytes
,jYio255/]tFTF1&!-&3a*5M~b*+3YG

Example run with the offline interpreter. The images are input by their URL's (local filenames could also be provided).

Explanation
,        % Do this twice
  j      %   Input string with URL or filename
  Yi     %   Read image as an M×N×3 uint8 array
  o      %  Convert to double
  255/   %   Divide by 255
]        % End
t        % Duplicate the second image
FTF      % Push 1×3 vector [0 1 0]
1&!      % Permute dimensions to give a 1×1×3 vector
-        % Subtract from the second image (M×N×3 array), with broadcast
&3a      % "Any" along 3rd dim. This gives a M×N mask that contains
         % 0 for pure green and 1 for other colours
*        % Mulltiply. This sets green pixels to zero
5M       % Push mask M×N again
~        % Negate
b        % Bubble up the first image
*        % Multiply. This sets non-green pixels to zero
+        % Add the two images
3YG      % Show image in a window

Pyth, 27 bytes
M?q(Z255Z)GHG.wmgVhded,V'E'

It takes quoted input. The input are the two paths of the image files. Output a file o.png Unfortunately that cannot be tested on the online interpreter for safety reason (' is disabled on it). You will need to get Pyth on your computer to test it.
Explanation
M?q(Z255Z)GHG                  # Define a function g which takes two tuples G and H and returns G if G != (0, 255, 0), H otherwise
                       V'E'    # Read the images. They are returned as lists of lists of colour tuples
                      ,        # Zip both images
               m  hded         # For each couple of lists in the zipped list...
                gV             # Zip the lists using the function g
             .w                # Write the resulting image to o.png

The chroma-key blend function on its own is 13 bytes, same as my x86 machine-code answer.  I didn't realize earlier that this was a complete program handing image I/O as well.

Matlab 2016b and Octave, 62 59 bytes
Input: A = MxNx3 unit8 foreground matrix, B = MxNx3 unit8 background matrix.
k=sum(A(:,:,2)-A(:,:,[1 3]),3)==510.*ones(1,1,3);A(k)=B(k);

Output: A = MxNx3 unit8 matrix
Sample use:
A = imread('foreground.png');
B = imread('backgroundimg.png');

k=sum(A(:,:,2)-A(:,:,[1 3]),3)==510.*ones(1,1,3);A(k)=B(k);

imshow(A)

C++, 339 bytes
This uses CImg, and it can take files in other formats, too. The result is displayed in a window.
#include<CImg.h>
using namespace cimg_library;
int main(int g,char** v){CImg<unsigned char> f(v[1]),b(v[2]);for(int c=0;c<f.width();c++){for(int r=0;r<f.height();r++){if((f(c,r)==0)&&(f(c,r,0,1)==255)&&(f(c,r,0,2)==0)){f(c,r)=b(c,r);f(c,r,0,1)=b(c,r,0,1);f(c,r,0,2) = b(c,r,0,2);}}}CImgDisplay dis(f);while(!dis.is_closed()){dis.wait();}}

Compile with g++ chromakey.cpp -g -L/usr/lib/i386-linux-gnu -lX11 -o chromakey -pthread.

R, 135 bytes
function(x,y,r=png::readPNG){a=r(x);m=apply(a,1:2,function(x)all(x==0:1));for(i in 1:4)a[,,i][m]=r(y)[,,i][m];png::writePNG(a,"a.png")}

Anonymous function, takes 2 png file paths as arguments and output a png picture called a.png.
Slightly ungolfed, with explanations:
function(x,y){
    library(png)
    # readPNG output a 3D array corresponding to RGBA values on a [0,1] scale:
    a = readPNG(x)
    # Logical mask, telling which pixel is equal to c(0, 1, 0, 1),
    # i.e. #00FF00 with an alpha of 1:
    m = apply(a, 1:2, function(x) all(x==0:1))
    # For each RGB layer, replace that part with the equivalent part of 2nd png:
    for(i in 1:4) a[,,i][m] = readPNG(y)[,,i][m]
    writePNG(a,"a.png")
}

SmileBASIC, 90 bytes whats the key
DEF C I,J
DIM T[LEN(I)]ARYOP.,T,I,16711936ARYOP 2,T,T,T
ARYOP 6,T,T,0,1ARYOP 5,I,I,J,T
END

I is the foreground and output, J is the background.
Both are integer arrays of pixels, in 32 bit ARGB format.
Ungolfed
DEF C IMAGE,BACKGROUND 'function
 DIM TEMP[LEN(IMAGE)]  'create array "temp"
 ARYOP #AOPADD,TEMP,IMAGE,-RGB(0,255,0)    'temp = image - RGB(0,255,0)
 ARYOP #AOPCLP,TEMP,TEMP,-1,1              'temp = clamp(temp, -1, 1)
 ARYOP #AOPMUL,TEMP,TEMP,TEMP              'temp = temp * temp
 ARYOP #AOPLIP,IMAGE,IMAGE,BACKGROUND,TEMP 'image = linear_interpolate(image, background, temp)
END

Explanation:
ARYOP is a function that applies a simple operation to every element in an array.
It is called like ARYOP mode, output_array, input_array_1, input_array_2, ...
First, to determine which pixels in the image are green, -16711936 (the RGBA representation of the green color) is subtracted from each pixel in the foreground image. This gives an array where 0 represents green pixels, and any other number represents non-green pixels.
To convert all nonzero values to 1, they are squared (to remove negative numbers), then clamped to between 0 and 1.
This results in an array with only 0s and 1s.
0s represent green pixels in the foreground image, and should be replaced with pixels from the background.
1s represent non-green pixels, and those will need to be replaced with pixels from the foreground.
This can easily be done using linear interpolation.

PHP, 187 bytes
for($y=imagesy($a=($p=imagecreatefrompng)($argv[1]))-1,$b=$p($argv[2]);$x<imagesx($a)?:$y--+$x=0;$x++)($t=imagecolorat)($b,$x,$y)-65280?:imagesetpixel($b,$x,$y,$t($a,$x,$y));imagepng($b);

assumes 24bit PNG files; takes file names from command lines arguments, writes to stdout.
Run with -r.
breakdown
for($y=imagesy(                                 # 2. set $y to image height-1
        $a=($p=imagecreatefrompng)($argv[1])    # 1. import first image to $a
    )-1,
    $b=$p($argv[2]);                            # 3. import second image to $b
    $x<imagesx($a)?:                            # Loop 1: $x from 0 to width-1
        $y--+$x=0;                              # Loop 2: $y from height-1 to 0
        $x++)
            ($t=imagecolorat)($b,$x,$y)-65280?:     # if color in $b is #00ff00
                imagesetpixel($b,$x,$y,$t($a,$x,$y));   # then copy pixel from $a to $b
imagepng($b);                                   # 5. output

JavaScript (ES6), 290 bytes
a=>b=>(c=document.createElement`canvas`,w=c.width=a.width,h=c.height=a.height,x=c.getContext`2d`,x.drawImage(a,0,0),d=x.getImageData(0,0,w,h),o=d.data,o.map((_,i)=>i%4?0:o[i+3]=o[i++]|o[i++]<255|o[i]?255:0),x.drawImage(b,0,0),createImageBitmap(d).then(m=>x.drawImage(m,0,0)||c.toDataURL()))

Takes input as two Image objects (in currying syntax), which can be created with an HTML <image> element. Returns a Promise that resolves to the Base64 data URL of the resulting image, which can be applied to the src of an <image>.
The idea here was to set the alpha value for each #00FF00 pixel to 0 and then paint the foreground, with its background keyed out, on top of the background.
Test Snippet
Including the foreground and background by their data URLs was too large to post here, so it was moved to CodePen:
Try it online!

OSL, 83 bytes
shader a(color a=0,color b=0,output color c=0){if(a==color(0,1,0)){c=b;}else{c=a;}}

Takes two inputs. The first is the foreground, and the second, the background.

C (gcc), 248 245 bytes
-3 bytes thanks to @ceilingcat
#define F(N)for(i=0;i<N;++i)
#define V x,y,z,w
*S="P%d %d %d %d ";V;v[6];main(i,f)int**f;{F(2)fscanf(f[i]=fopen(f[i+1],"r"),S,&x,&y,&z,&w);for(printf(S,V);~*v;x=0){F(3)x||putchar(i[!(*v|v[1]-255|v[2])*3+v]);F(3)v[i+3]=getc(*f),v[i]=getc(f[1]);}}

Try it online!


text:
Smallest chess game compression
Inspiration:
Heavily inspired by Smallest chess board compression I decided to make a similar but distinctly different competition.
tl;dr
Take the file Chess_Games.txt and compress it as much as you can so that you can expand it to the original file.
Objective:
Write an algorithm to encode and decode an entire chess database from start position to end
The encoding must be able to determine for all of the games all the positions:

The location all the pieces
Whose turn it is
Whether the player can castle on each side.
Whether the player can perform an en-passant, and if so, which of their pawns?
The previous position

Additionally:

Each game should also include who won and how it ended (forfeit, draw, checkmate, stalemate, etc...)

Input/Output:
There should be 2 algorithms Compress/Expand which satisfy the following properties:

Compress takes in a file of games via a sequence of moves via chess notation and output compressed file
Expand does the opposite, taking in a compressed file and outputting the original file with all the games in the same order
Correctness:  Expand(Compress(file)) = file for all properly formed files

Any game that is not well formed or violates the rules of chess is considered bad.  All bad games may be skipped.
It must be able to parse sen notation.  Look at chessgames.com and https://database.lichess.org/ for some examples.
I have compiled a file of the first 10000 games from "May 2017" in Chess_Games.txt
The file should look like the following:
e4 d5 exd5 Nf6 d3 Qxd5 Nc3 Qf5 Be2 Bd7 g4 Qe6 g5 Nd5 Ne4 Bc6 Bg4 Qe5 f4 Qd4 Nf3 Qb6 Qe2 e6 Be3 Qa6 O-O Nd7 c4 Ne7 f5 Bxe4 dxe4 exf5 exf5 O-O-O f6 gxf6 gxf6 Nc6 Nd4 Nxd4 Bxd4 Bc5 Bxc5 Rhg8 Be7 Rde8 b4 Qxf6 Bxf6 Rxe2 h3 h5 Kh1 hxg4 Rg1 Nxf6 Rae1 Rxe1 Rxe1 gxh3 Kh2 Ng4+ Kxh3 Nf2+ Kh2 Ng4+ Kg3 f5 Kf4 Nh6 Re7 Rg4+ Ke5 Kd8 Kf6 Ng8+ Kf7 Nxe7 Kf8 f4 c5 f3 c6 f2 cxb7 Nc6 b8=Q+ Nxb8 Kf7 Kd7 0-1
d3 e6 e3 d5 Nf3 Nf6 Be2 Be7 O-O O-O Nc3 Nbd7 Ne1 c5 f3 e5 e4 d4 Nb1 b6 f4 exf4 Rxf4 Qc7 Rf3 Bd6 g3 Ng4 Rf1 Ndf6 Bxg4 Bxg4 Qd2 Rae8 Qf2 Re5 Bf4 Rh5 Bxd6 Qxd6 Nf3 c4 e5 Rxe5 Nxe5 Qxe5 Nd2 cxd3 cxd3 Be2 Rfe1 Qe3 Qxe3 dxe3 Ne4 Bxd3 Nxf6+ gxf6 Rxe3 Bg6 Rae1 Kg7 h4 h5 R1e2 Bf5 Rg2 Bg4 Re4 Kg6 Rge2 f5 Re5 f6 Re6 Rg8 Re7 Rg7 Re8 1-0
d4 d5 e4 dxe4 c4 Nf6 Qc2 Bf5 Nc3 Qxd4 Be3 Qe5 Nge2 e6 Ng3 Bb4 a3 Bxc3+ bxc3 Nc6 Be2 Na5 O-O Nxc4 Bd4 Qb5 Nxf5 exf5 Bxf6 gxf6 Rab1 Nxa3 Qa2 Qxb1 Rxb1 Nxb1 Qxb1 O-O-O Qb3 b6 Ba6+ Kb8 Qb5 Rhe8 Qc6 1-0
e3 c5 d3 d5 Nf3 Nc6 Be2 Nf6 O-O g6 h3 Bg7 Re1 O-O Nbd2 Re8 Nf1 e5 c3 b6 N3h2 Bb7 Qc2 Qc7 b3 Rac8 Bb2 a5 Rac1 a4 Qb1 axb3 axb3 Ba6 d4 Bxe2 Rxe2 exd4 cxd4 Qb8 dxc5 d4 Ree1 dxe3 Rxe3 Nd5 Rxe8+ Rxe8 Bxg7 Kxg7 Re1 Rxe1 Qxe1 bxc5 Qd1 Nd4 Ne3 Nf4 Neg4 Qxb3 Qe1 Qd5 Ne3 Qe6 Qf1 c4 Nhg4 Nde2+ Kh2 c3 g3 c2 gxf4 c1=Q Qxc1 Nxc1 Ng2 Qe4 Kg3 Nd3 f3 Qe2 Nh4 h5 Nh2 Qe1+ Kg2 Nf2 Nf5+ gxf5 Kg3 Qg1+ Kh4 Nxh3 Kxh5 1-0
e4 d5 exd5 Qxd5 Nc3 Qd8 d4 Bf5 Nf3 e6 Nh4 Bg6 Nxg6 hxg6 Be3 Bd6 Bc4 a6 Qf3 c6 O-O-O Nd7 Ne4 Qc7 Nxd6+ Qxd6 Bf4 Qb4 Bb3 Ngf6 Rhe1 O-O-O Bg3 a5 Qf4 Qb6 Re3 Rh5 Bc4 Rf5 Qd6 Ne8 Qa3 Qa7 Red3 b5 Bxb5 cxb5 Rc3+ Kb7 Qe7 b4 Rc5 Rxc5 dxc5 Qxc5 Qxd8 Ndf6 Qb8+ Ka6 Rd8 Qa7 Rxe8 Nxe8 Qxe8 Qc5 Qa8+ Kb5 Qb8+ Ka4 b3+ Ka3 Qf4 Qc3 Qe5 1-0
e4 d5 exd5 Qxd5 Nf3 Qd8 Nc3 e6 Bc4 Nf6 Bb3 Be7 a3 a6 O-O O-O h3 b6 d3 Bb7 Bg5 Nbd7 Ne4 h6 Bh4 Nxe4 Bxe7 Qxe7 dxe4 Bxe4 Re1 Bb7 Ba2 Nf6 b4 Rfd8 Qc1 Qd6 c4 Qc6 Qc2 Rd7 Rac1 Rad8 c5 bxc5 Qxc5 Qb5 Qxb5 axb5 Ne5 Rd2 Bb3 Rb2 Bd1 Rdd2 Re2 Rxe2 Bxe2 Rxe2 Nf3 Ra2 Rxc7 Bd5 Rc8+ Kh7 Ne5 Rxa3 Rf8 Ra1+ Kh2 h5 Rxf7 Kh6 Rf8 Kg5 g3 Kf5 Nd7 Ra2 Nxf6 gxf6 Rg8 Rxf2+ Kg1 Rg2+ Kf1 Rh2 g4+ hxg4 hxg4+ Ke5 Re8 Rh1+ Kf2 Rh2+ Kg3 Rg2+ Kh4 Rf2 Kg3 Rf4 g5 Re4 gxf6 Kxf6 Rf8+ Ke5 Rh8 Re3+ Kf2 Re4 Rh5+ Kd4 Rh6 Rf4+ Kg3 Re4 Rh8 Re3+ 0-1
...

Scoring:
In order to make things objective, the winner is the algorithm that can compress the files at https://database.lichess.org/ as small as possible.  The target database is the "May 2017".  The winner is whoever has the smallest file that expands properly.
The file to use is Chess_Games.txt which is the first 10000 games from the "May 2017" database at https://database.lichess.org/ with all of the header information removed.  This file will be the benchmark to use.  It should be 2,789,897 bytes with a SHA-256 hash of 56b6d2fffc7644bcd126becd03d859a3cf6880fa01a47fa08d4d6a823a4866bc (Pastebin might remove the last newline after game 10000)
Naive Solution:
Using generic compression algorithms:

zip: 647,772 bytes (76.841%)
7z:  652,813 bytes (76.661%)
bz2: 722,158 bytes (74.182%)
xz:  784,980 bytes (71.936%)
rar: 853,482 bytes (69.487%)
gz:  923,474 bytes (66.985%)

There shouldn't be a space after http://

Thanks for fixing it.  The site wouldn't let me post a question with more than 1 link since I don't have the appropriate reputation.  So i added a space and hoped someone else would fix it or I could fix it later.

No problem, I understand the pain.

Nice question! Could you elaborate more on how the scoring is calculated? Also, which variant of the standard chess notation should we expect and output? In the future, you might find the Sandbox helpful :)

Could we get the chess game/notation you'll be using to score the answers?

@AndersKaseorg:  That's a very good suggestion, I just don't have the time to find all those games and run each algorithm on them.  If you would like you are more than welcome to compile a collection of games and I will add them to the winning criterion.  Also although there are a finite number of games the space complexity is still objective.  For example if i asked you "which sorting algorithm is faster on lists of 8-byte integers of length 10000, bubble sort or quicksort?" the answer would still be quicksort even though there are only a finite number of values (specifically (2^(8*8))^10000)

@AndersKaseorg: I took your suggestion and found several databases at https://database.lichess.org/ for us to use.  The goal is now to have the highest compression ratio from raw games to compressed games.

I agree, that is why I am taking that file and extracting only the moves so it looks like the example above.  Then I'll truncate it to only the first 10,000 games and upload that to the pastebin link above.

@AndersKaseorg I had forgotten about that, thanks!

I stripped the annotations from the benchmark file and removed the confusing references the draw rules to make everything clearer.  I changed the statement about parsing to use those sites as a reference.

Python, score = 418581 bytes
This uses a bijective variant of asymmetric numeral systems.  Because it’s bijective, you can not only compress any valid list of chess games into a file and expand it back to the same list—you can also expand any file into a valid list of chess games and compress it back to the same file!  Perfect for hiding your porn collection.
Requires python-chess.  Run with python script.py compress or python script.py expand, both of which will read from standard input and write to standard output.
import chess
import sys

RESULTS = ['1-0\n', '1/2-1/2\n', '0-1\n', '*\n']
BITS = 24

def get_moves(board):
    if board.is_insufficient_material() or not board.legal_moves:
        return [board.result() + '\n']
    else:
        return RESULTS + sorted(
            board.legal_moves,
            key=lambda move: (move.from_square, move.to_square, move.promotion))

def read_bijective():
    buf = bytearray(getattr(sys.stdin, 'buffer', sys.stdin).read())
    carry = 0
    for i in range(len(buf)):
        carry += buf[i] + 1
        buf[i] = carry & 0xff
        carry >>= 8
    if carry:
        buf.append(carry)
    return buf

def write_bijective(buf):
    carry = 0
    for i in range(len(buf)):
        carry += buf[i] - 1
        buf[i] = carry & 0xff
        carry >>= 8
    while carry:
        carry = (carry << 8) + buf.pop() + 1
    getattr(sys.stdout, 'buffer', sys.stdout).write(buf)

def add_carry(buf, carry):
    for i in range(len(buf)):
        if carry == 0:
            break
        carry += buf[i]
        buf[i] = carry & 0xff
        carry >>= 8
    return carry

def do_compress():
    board = chess.Board()
    state = 0
    buf = bytearray()

    games = []
    for sans in sys.stdin:
        game = []
        for san in sans.split(' '):
            move = san if san in RESULTS else board.parse_san(san)
            moves = get_moves(board)
            game.append((len(moves), moves.index(move)))
            if move in RESULTS:
                board.reset()
            else:
                board.push(move)
        games.append(game)

    for game in reversed(games):
        for (n, i) in reversed(game):
            q = ((1 << BITS) - 1 - i) // n + 1
            while state >= q << 8:
                buf.append(state & 0xff)
                state >>= 8
            hi, j = divmod(state, q)
            lo = n * j + i
            state = hi << BITS | lo
        state += add_carry(buf, 1)

    while state:
        buf.append(state & 0xff)
        state >>= 8
    write_bijective(buf)

def do_expand():
    board = chess.Board()
    state = 0
    buf = read_bijective()

    while True:
        while buf and state < 1 << BITS:
            state = state << 8 | buf.pop()
        if state == 0:
            break
        state += add_carry(buf, -1)

        while True:
            moves = get_moves(board)
            while buf and state < 1 << BITS:
                state = state << 8 | buf.pop()
            n = len(moves)
            hi, lo = divmod(state, 1 << BITS)
            j, i = divmod(lo, n)
            q = ((1 << BITS) - 1 - i) // n + 1
            state = j + q * hi
            move = moves[i]
            if move in RESULTS:
                sys.stdout.write(move)
                board.reset()
                break
            else:
                sys.stdout.write(board.san(move).rstrip('+#') + ' ')
                board.push(move)

if __name__ == '__main__':
    {'compress': do_compress, 'expand': do_expand}[sys.argv[1]]()

Verified on Ubuntu 17.04 using Python 2.7.13 and ran each command separately.

This is really great! I am also intrigued what pornographic chess games will be like in practice.

Python, score = 426508 bytes
Compression Function:
  (
  m+1
  )
  ⋅
  log2
  (
  b+1
  )

m is number of moves and b is branching factor
Attempt 1:
I answered the question at Smallest chess board compression so I'm trying to fix it up to post here.
Naively I thought that I can encode each move in 12 bits, 4 triplets of the form (start x, start y, end x, end y) where each is 3 bits.
We would assume the starting position and move pieces from there with white going first.  The board is arranged such that

      (
      0
      ,
      0
      )

 is white's lower left corner.
For example the game:
  e4    e5
 Nf3    f6
Nxe5  fxe5
...    ...

Would be encoded as:
100001 100010 100110 100100
110000 101010 101110 101101
101010 100100 101101 100100
...

This leads to an encoding of 12 m bits where m is the number of moves made.
Attempt 2:
I realized that each move in the previous attempt encodes many illegal moves.  So I decided to only encode legal moves.  We enumerate possible moves as follows, number each square such that
  (
  0
  ,
  0
  )
  →
  0
,
  (
  1
  ,
  0
  )
  →
  1
,
  (
  x
  ,
  y
  )
  →
  x
  +
  8
  y
.  Iterate through the tiles and check if a piece is there and if it can move.  If so add the positions it can go to to a list.  Choose the list index that is the move you want to make.  Add that number to the running total of moves weighted by 1 plus the number of possible moves.
Example as above:
From the starting position the first piece that can move is the knight on square 1, it can move to square 16 or 18, so add those to the list [(1,16),(1,18)].  Next is the knight on square 6, add it's moves.  Overall we get:
[(1,16),(1,18),(6,21),(6,23),(8,16),(8,24),(9,17),(9,25),(10,18),(10,26),(11,19),(11,27),(12,20),(12,28),(13,21),(13,29),(14,22),(14,30),(15,23),(15,31)]
Since we want the move
  (
  12
  ,
  28
  )
, we encode this as 13 in base 20 since there are 20 possible moves.
So now we get the game number

    g0

  =
  13

Next we do the same for black except we number the tiles in reverse (to make it easier, not required) to get the list of moves:
[(1,16),(1,18),(6,21),(6,23),(8,16),(8,24),(9,17),(9,25),(10,18),(10,26),(11,19),(11,27),(12,20),(12,28),(13,21),(13,29),(14,22),(14,30),(15,23),(15,31)]
Since we want the move
  (
  11
  ,
  27
  )
, we encode this as 11 in base 20 since there are 20 possible moves.
So now we get the game number
  g1
  =
  (
  11
  ⋅
  20
  )
  +
  13
  =
  233

Next we get the following list of moves for white:
[(1,16),(1,18),(3,12),(3,21),(3,30),(3,39),(4,12),(5,12),(5,19),(5,26),(5,33),(5,40),(6,12),(6,21),(6,23),(8,16),(8,24),(9,17),(9,25),(10,18),(10,26),(11,19),(11,27)(13,21),(13,29),(14,22),(14,30),(15,23),(15,31)]
Since we want the move
  (
  6
  ,
  21
  )
, we encode this as 13 in base 29 since there are 29 possible moves.
So now we get the game number
  g2
  =
  (
  (
  13
  ⋅
  20
  )
  +
  11
  )
  20
  +
  13
  =
  5433

Next we get the following list of moves for black:
[(1,11),(1,16),(1,18),(2,11),(2,20),(2,29),(2,38),(2,47),(3,11),(4,11),(4,18),(4,25),(4,32),(6,21),(6,23),(8,16),(8,24),(9,17),(9,25),(10,18),(10,26),(12,20),(12,28),(13,21),(13,29),(14,22),(14,30),(15,23),(15,31)]
Since we want the move
  (
  10
  ,
  18
  )
, we encode this as 19 in base 29 since there are 29 possible moves.
So now we get the game number
  g3
  =
  (
  (
  (
  19
  ⋅
  29
  +
  13
  )
  20
  )
  +
  11
  )
  20
  +
  13
  =
  225833

And continue this process for all the remaining moves.  You can think of g as the function
  g
  (
  x
  ,
  y
  ,
  z
  )
  =
  x
  y
  +
  z
.  Thus
  g0
  =
  g
  (
  1
  ,
  1
  ,
  13
  )
,
  g1
  =
  g
  (
  g
  (
  1
  ,
  1
  ,
  11
  )
  ,
  20
  ,
  13
  )
,
  g2
  =
  g
  (
  g
  (
  g
  (
  1
  ,
  1
  ,
  13
  )
  ,
  20
  ,
  11
  )
  ,
  20
  ,
  13
  )
,
  g3
  =
  g
  (
  g
  (
  g
  (
  g
  (
  1
  ,
  1
  ,
  19
  )
  ,
  29
  ,
  13
  )
  ,
  20
  ,
  11
  )
  ,
  20
  ,
  13
  )

To decode a game number g0, we start at the initial position and enumerate all possible moves.  Then we compute g1 = g0 // l, m0 = g0 % l, where l is the number of possible moves, '//' is the integer division operator and '%' is the modulus operator.  It should hold that g0 = g1 + m0.  Next we make the move m0 and repeat.
From the example above if g0 = 225833 then g1 = 225833 // 20 = 11291 and m0 = 225833 % 20= 13.  Next g2 = 11291 // 20 = 564 and m1 = 11291 % 20 = 11.  Then g3 = 11291 // 20 = 564 and m2 = 11291 % 20 = 11. Therefore g4 = 564 // 29 = 19 and_m_3 = 564 % 29 = 13. Finally g5= 19 // 29 = 0 and m4 = 19 % 29 = 19.
So how many bits are used to encode a game this way?
For simplicity, let's say there are always 35 moves each turn (https://en.wikipedia.org/wiki/Branching_factor) and for the worst case scenario we always pick the biggest one, 34.  The number we will get is
  34
  ⋅
  35m
  +
  34
  ⋅
  35m-1
  +
  34
  ⋅
  35m-2
  +
  ⋯
  +
  34
  ⋅
  35
  +
  34
  =
  35m+1
  −
  1
 where _m is the number of moves.  To encode
  35m+1
  −
  1
 we need about
  log2
  (
  35m+1
  )
 bits which is about
  (
  m
  +
  1
  )
  ⋅
  log2
  (
  35
  )
  =
  5.129
  ⋅
  (
  m
  +
  1
  )

On average m = 80 (40 moves per player) so this would take 416 bits to encode.  If we were recording many games we would need a universal encoding since we don't know how many bits each number will need
Worst case when m = 11741 so this would take 60229 bits to encode.
Additional Notes:
Note that g = 0 denotes a valid game, the one where the piece on the lowest square moves to the lowest square it can.
If you want to refer to a specific position in the game you may need to encode the index.  This can be added either manually e.g concatenate the index to the game, or add an additional "end" move as the last possible move each turn.  This can now account for players conceding, or 2 in a row to denote the players agreed to a draw.  This is only necessary if the game did not end in a checkmate or stalemate based on the position, in this case it is implied.  In this case it brings the number of bits needed on average to 419 and in the worst case 60706.
A way to handle forks in a what-if scenario is to encode the game up to the fork and then encode each branch starting at the forked position instead of the initial position.
Implementation:
Take a look at my github repo for the code:
https://github.com/edggy/ChessCompress

source: Stack Exchange

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

sort: votes


text:
Make a base64 Quine!
Your challenge is to output a Base64-encoded version of your source code, and optionally a line break. You must output the correct padding, if any. Standard quine rules apply, shortest answer wins.
It must be a valid RFC 4648 encoded base64 string, with no linebreaks (except optionally a trailing newline).
Test cases:
h -> aA==
PPCG! -> UFBDRyE=
Programming Puzzles and Code Golf -> UHJvZ3JhbW1pbmcgUHV6emxlcyBhbmQgQ29kZSBHb2xm

#Base64 table
0   A   16  Q   32  g   48  w
1   B   17  R   33  h   49  x
2   C   18  S   34  i   50  y
3   D   19  T   35  j   51  z
4   E   20  U   36  k   52  0
5   F   21  V   37  l   53  1
6   G   22  W   38  m   54  2
7   H   23  X   39  n   55  3
8   I   24  Y   40  o   56  4
9   J   25  Z   41  p   57  5
10  K   26  a   42  q   58  6
11  L   27  b   43  r   59  7
12  M   28  c   44  s   60  8
13  N   29  d   45  t   61  9
14  O   30  e   46  u   62  +
15  P   31  f   47  v   63  /

If you want to test your submission, try base64encode.org.

https://codegolf.meta.stackexchange.com/a/8595/25180

RFC 4648 mentiones two alphabets. Which one should we use?

@Dennis the one in the table.

WTB a language that outputs the letter of the given index 0->A = win.

I've looked at this again after a few months and I still see this as clearly duplicate. All answers to the cryptiographic quine variant challenge work roughly by generating their own source and applying a built-in function to transform it to get its md5sum. Each of those answers could easily be rewritten to use a base64 builtin instead of a md5 built-in, without changing the core technique. I believe that counts as "little modification", making this challenge a duplicate.

Bash, 27 bytes
trap -- 'trap|base64' EXIT

Based on this Bash quine. Note the trailing linefeed.
Try it online!

why do I obtain dHJhcCAtLSAndHJhcHxiYXNlNjQnIEVYSVQ= and dHJhcCAtLSAndHJhcHxiYXNlNjQnIEVYSVQK ? (last char diff)

The program needs a trailing linefeed to be a valid base64 quine, which got removed by the syntax highlighter.

Javascript (ES6), 17 bytes
f=_=>btoa(`f=`+f)

I thought this solution would be obvious...

f=_=>btoa(`f=`+f)
console.log(f())
console.log(atob(f()))

Python, 133 112 bytes
from base64 import*;s=b'from base64 import*;s=%r;print(b64encode(s%%s).decode())';print(b64encode(s%s).decode())

Base64 representation:
ZnJvbSBiYXNlNjQgaW1wb3J0KjtzPWInZnJvbSBiYXNlNjQgaW1wb3J0KjtzPSVyO3ByaW50KGI2NGVuY29kZShzJSVzKS5kZWNvZGUoKSknO3ByaW50KGI2NGVuY29kZShzJXMpLmRlY29kZSgpKQ==

Try it online!

Alice, 72 69 bytes
-3 bytes thanks to Martin Ender.
".w6+55*&w.q+!]k;9&wq4-!]kq&[d.t&w;q,ww].4%~4:k;28d3:&wq&[&]?ow4*+k@;

Base 64 representation:
Ii53Nis1NSomdy5xKyFdazs5JndxNC0hXWtxJltkLnQmdztxLHd3XS40JX40Oms7MjhkMzomd3EmWyZdP293NCora0A7

If anything, the base 64 representation looks less inscrutable than the original program.
Try it online!
Explanation
Since Alice has no base64 built-in, the vast majority of this program is a reduced implementation of base64.  The quine framework prevents me from using ' to define constants in two bytes, but it also has some advantages.  As luck would have it, the length of the source code is divisible by 3, and the characters >, ?, and ~ do not appear at the end of a 3-character block.
The first step is to create (most of) the base64 alphabet.  The characters + and / do not appear in the base64 representation of the source code, so we do not need to handle them.  This saves 9 bytes.
"      wrap the entire source code in a string and push each byte

.      copy ; from top of stack (i.e., push 59)
w      push return address (i.e., do the following twice)
6+     add 6 to the constant on the stack
       this gives us 65 in the first iteration, and 71 in the second
55*w   do the following 26 times:
.q+    add tape position to constant
!      store at tape position
]      move tape right
k      return to pushed return address (end both loops)
;      remove constant from the stack, since it's no longer needed
9&w    do 10 times:
q4-    tape position minus 4
!      store at tape position
]      move tape right
k      repeat
q&[    return to position 0

Positions 0-61 on the tape are now filled with their base64 character equivalents.  We now convert the source code to base 4.
d.     push stack depth (length of code excluding "), and put a useless copy below it
t&w    do that many times:
;      remove top of stack (copy of length on first iteration, 0 otherwise)
q,     move next byte to top of stack (using tape position as a register)
ww     do 4 times:
]      move tape forward (increase counter)
.      duplicate current byte or part thereof
4%     mod 4
~      swap: work with other copy
4:     divide by 4
k      repeat (end both loops)
;28    remove the excess 0 and push the base 4 representation of ",
       except that the first three base 4 digits are already in base 64

Finally, we convert from base 4 to base64 and output.
d3:&w  push return address once for each output character
q&[    move tape to position 0
&]     move tape to position corresponding to base 64 digit
?      get character from tape
o      output
w4*+   convert next base 64 digit (equivalent to 4*+4*+)
k      repeat until stack is empty
@      terminate

If you can save another byte elsewhere, could you shorten 6a*t by putting a ; at the end of the program and a . after the "?

As it turns out, rearranging my base 4 -> base 64 conversion allowed me to save a third byte.

C (gcc), 342 bytes
f(a){putchar(a>61?43+a%2*4:a>51?a-4:a+65+a/26*6);}main(a){char*s="f(a){putchar(a>61?43+a%2*4:a>51?a-4:a+65+a/26*6);}main(a){char*s=%c%s%c,*t=malloc(342);for(sprintf(t,s,34,s,34);*t;f(*t%4*16+*++t/16),f(*t%16*4+*++t/64),f(*t++%64))f(*t/4);}",*t=malloc(342);for(sprintf(t,s,34,s,34);*t;f(*t%4*16+*++t/16),f(*t%16*4+*++t/64),f(*t++%64))f(*t/4);}

Try it online!

Mathematica, 108 bytes
Print[StringDelete[ExportString[StringJoin["Print[", ToString[#0, InputForm], "[]]"], "Base64"], "\n"] & []]

Full program. The spaces are necessary as part of the InputForm formatting. Output, note the trailing linefeed character:
UHJpbnRbU3RyaW5nRGVsZXRlW0V4cG9ydFN0cmluZ1tTdHJpbmdKb2luWyJQcmludFsiLCBUb1N0cmluZ1sjMCwgSW5wdXRGb3JtXSwgIltdXSJdLCAiQmFzZTY0Il0sICJcbiJdICYgW11d

Java 8, 202 bytes
v->{String s="v->{String s=%c%s%1$c;return java.util.Base64.getEncoder().encodeToString(s.format(s,34,s).getBytes());}";return java.util.Base64.getEncoder().encodeToString(s.format(s,34,s).getBytes());}

Explanation:
Try it online.

The String s contains the unformatted source code.
%s is used to input this String into itself with the s.format(...).
%c, %1$c and the 34 are used to format the double-quotes.
s.format(s,34,s) puts it all together.

And then java.util.Base64.getEncoder().encodeToString(....getBytes()) is used to encode the entire source code to a Base64-String.
Try it here with the Base64-encoding part removed to prove it's a quine.

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


text:
Net neutrality: Is my internet being throttled?
From the wikipedia:

Net neutrality is the principle that Internet service providers and governments regulating the Internet should treat all data on the Internet the same, not discriminating or charging differentially by user, content, website, platform, application, type of attached equipment, or mode of communication.

Your task is to find if your internet connection is being throttled by your ISP or if the net is neutral.
What you actually have to do
Your program or function will be run twice. It needs to have some form of memory or storage between its two calls, like writing to a file, a static var in C++, setting a property on a function in JS, or just a global variable.
The first time it is run, it must connect to google.com (a fairly popular site), and a different website with an Alexa rank of greater than 1 million, like unlicense.org.
It must record the time it took google.com to respond*, and the time it took the other website to respond*.
The second time it is run, it must do the above, and print a truthy value if these are both true:

The response time between google.com the first and second time varied by less than 5%. (Google paid ISP to not throttle)
The response time between the other site the first and second time increased by more than 50%. (Other site didn't)

Shortest code wins!

* The time it to get the response body, headers, or just connect with the server. You choose.

Is there any method you could recommend of finding such a site with an Alexa ranking greater than 1 million?

@notjagan done.

Why the downvotes?

To clarify, you mean a site with a larger rank and thus lower traffic, right? I at first thought you meant a high rank.

Also, theoretically, wouldn't it be a much longer time based on the location of the site's servers?

@Riker Yep. Latency and ping would do a good lot, but unlicense is run by github, so servers for both sites should be pretty well distributed.

Also, the time to get the full response body is pointless. It will take much longer to download larger bodies than others. Google is likely a much smaller body than unlicense. You should be measuring the time between when the request is submitted, and the first headers are received.

I think having to run it twice is a bad idea. One run please?

@Zizouz212 fixed.

Python 3 + requests, 185 bytes
lambda t=[]:t.append([g("http://google.com"),g("http://a.co")])or len(t)>1and abs(1-t[0][0]/t[1][0])<.05<1.5<t[1][1]/t[0][1]
g=lambda s:get(s).elapsed.microseconds
from requests import*

Unfortunately requests doesn't work with TIO, so I'll have to post a link on another service later. Uses http://a.co as the website with a ranking greater than 1 million.
207 bytes, if time is required for the full body
f=lambda t=[]:t.append([g("http://google.com"),g("http://a.co")])or len(t)>1and abs(1-t[0][0]/t[1][0])<.05<1.5<t[1][1]/t[0][1]
def g(s):t=time();get(s);return time()-t
from requests import*
from time import*

Your answer is basically what I wrote too. The problem with the elapsed attribute of a request is that it's the measured time between when the request was submitted outbound, and when the module first started parsing the first response headers that it received. Not the full response body :)

@Zizouz212 Wouldn't it make more sense for it to measure the time to response headers? The full body would be dependent on the size of the page and not solely the time to connection.

Oh no, I completely agree. I even mentioned it in the comment above on the question as well (I wrote nearly the same answer with python 2 requests). It's just the question wants the time for the response body to arrive as well, which I figured I'd just mention

Since requests is an external library that isn't in vanilla Python (which is why it isn't on TIO), officially your header should say Python 3 + [requests](http://docs.python-requests.org/en/master/), just a heads up

@ValueInk But requests is part of vanilla Python - in fact, you can import it on TIO. The problem with it on TIO is you can't actually make requests (i.e. through requests.get) because TIO restricts network access.

Really? I just tried it on my Python 3.5.2 and got a ImportError: No module named 'requests'. The requests website also tells you to run pip install requests to install it. Wonder what's up with that (maybe the TIO machine has it installed already?)

@ValueInk Ah, it seems I was mistaken since requests is just so ubiquitous - it's not actually a standard library. requests is most likely just a module pre-installed on TIO since it's so common; other such modules include numpy.

requests doesn't work with TIO because the TIO arenas can't access the internet at all. This is a restriction that is unintentional and will likely not change. It is due to the internal arena communication servers, and some VPN/DNS/SomeFancyInternetStuff ... obnoxiousness.


text:
Pulse Measurement of Heart Arrhythmia
In this challenge you have to make an ascii pulsing heart with rhythm problems (Heart arrhythmia) and then measure the pulse.Don't worry it's easy!
Making the heart
The heart alternates between these 2 states:
state 1
    ,d88b.d88b,
    88888888888
    `Y8888888Y'
      `Y888Y'
        `Y'

state 2
     d8b d8b
    888888888
    `Y88888P'
     `Y888P'
      `Y8P'
       `Y'

each step has X seconds delay
where X is a Random (Real) number between 0.3 and 1.4 (0.3<=X<=1.4)
Measuring the Pulse
When your arrhythmia-heart starts beating, you have to measure the pulse.
We want to know the heartbeats/min.
But (like many doctors do) you only have to count the heartbeats for 15 sec and then multiply by 4
Final output
Given no input, your code must run for 15 seconds (displaying the beating heart) and then print the heart rate.
Your output should look exactly like this!
(I will run my code 2 times for you to see the different results)
First example run:

Second example run:

you must output one heart
Good Luck!
this is code-golf
shortest answer in bytes wins!

Could you replace the two hearts with just 1? It makes the post more confusing

Should the output rate be computed from the pause times or from the actual running time (which will be slightly greater than the sum of pause times)?

@cairdcoinheringaahing I've separated the figures to make it clear they are two independent runs

@LuisMendo Sorry I was afk.15 sec is the actual running time.Thanks for editing. I wanted to make sure that there is not a unique result.

Mathematica, 212 bytes
g=",d88b.d88b,
88888888888
`Y8888888Y'
  `Y888Y'
    `Y'";h=" d8b d8b
888888888
`Y88888P'
 `Y888P'
  `Y8P'
   `Y'";t=1;TimeConstrained[Monitor[While[1<2,If[OddQ@t,b=g,b=h];Pause@RandomReal@{.3,1.4};t++],b],15];4t

Python [on Windows], 262 bytes
from time import*
import os,random
t,i=time(),0
while time()-t<15:print([""",d88b.d88b,
88888888888
`Y8888888Y'
  `Y888Y'
    `Y'""",""" d8b d8b
888888888
`Y88888P'
 `Y888P'
  `Y8P'
   `Y'"""][i%2]);i+=1;sleep(random.randint(3,14)/10);os.system('cls')
print(i*4)

For linux and macOS use os.system('clear') for 2 more bytes.

You can xor i to save 2 bytes [i%2];i+=1 becomes [i];i^=1

you have extra spaces after your second heart, i got it down to 262 bytes by removing them

@cairdcoinheringaahing I need i for print(i*4)

@micsthepick its missing some spaces, it results in one byte more actually

@FelipeNardiBatista thanks! fixed

Java, 374 bytes
class G{public static void main(String[]a)throws Exception{long t=System.currentTimeMillis(),i=0;while(System.currentTimeMillis()<15000+t){p(",d88b.d88b,\n88888888888\n`Y8888888Y'\n  `Y888Y'\n    `Y'\n");Thread.sleep((long)(300+(Math.random()*1100)));i++;p(" d8b d8b\n888888888\n`Y88888P'\n `Y888P'\n  `Y8P'\n   `Y'\n");}p(i*4);}static<T>void p(T s){System.out.println(s);}}

Ungolfed:
public class Golf {
    public static void main(String[]a)throws Exception {
        long t=System.currentTimeMillis(),i=0;
        while(System.currentTimeMillis()<15000+t) {
            p(",d88b.d88b,\n88888888888\n`Y8888888Y'\n  `Y888Y'\n    `Y'\n");
            Thread.sleep((long)(300+(Math.random()*1100)));
            i++;
            p(" d8b d8b\n888888888\n`Y88888P'\n `Y888P'\n  `Y8P'\n   `Y'\n");
        }
        p(i*4);
    }
    static<T>void p(T s){System.out.println(s);}
}


text:
Are these braids equal?

If you are not familiar with Braid-Theory I recommend that you read this first.  This question assumes that you are at least familiar with the concepts at hand and assumes you are well familiar with group-theory

Let us define \$\sigma_n\$ to be the braid in which the \$n\$th strand (One indexed) from the top crosses over the \$n+1\$th strand, and \$\sigma_n^-\$ to be the inverse of \$\sigma_n\$ (That is the \$n+1\$th strand crosses the \$n\$th strand).
The braid group \$B_n\$ is then generated by \$\langle\sigma_1,\sigma_2,\sigma_3,\dots,\sigma_{n-1}\rangle\$.  Thus every braid on \$B_n\$ can be written as the product of the \$\sigma\$-braids.1

Determining if two braids on a group are equal is not a simple task.  It may be pretty obvious that \$\sigma_1\sigma_3 = \sigma_3\sigma_1\$, but it is a little less obvious that for example \$\sigma_2\sigma_1\sigma_2 = \sigma_1\sigma_2\sigma_1\$.2
So the question is "How can we determine if two braids are the same?".  Well the two examples above each represent a bit of this.  In general the following relations, called Artin's relations, are true:

\$\sigma_i\sigma_j = \sigma_j\sigma_i; i - j > 1\$

\$\sigma_i\sigma_{i+1}\sigma_i = \sigma_{i+1}\sigma_i\sigma_{i+1}\$

We can use these two relations in conjunction with the group axioms to prove that any equal braids are equal.  Thus two braids are equal iff the repeated application of these relations and the group axioms can demonstrate so.
Task
You will write a program or function to take two braids and determine whether or not they are equal.  You may also optionally take a positive integer representing the order of the group.
This is a code-golf question so answers will be scored in bytes, with less bytes being better.
Input and Output
You should represent a Braid as an ordered list of generators, (or any equivalent structure, e.g. vector).  You may represent the generators in any reasonable form (e.g. an integer, a two tuple of a positive integer and a boolean).
On par with standard descision-problem rules you should output one of two distinct values, an accept an reject.
Test Cases
[],       []              -> True
[1,-1],   []              -> True
[1,2,1],  [2,1,2]         -> True
[1,3],    [3,1]           -> True
[1,3,2,1],[3,2,1,2]       -> True
[1,4,-4,3,2,1], [3,2,1,2] -> True
[2,2,1],  [2,1,2]         -> False
[1,2,-1], [-1,2,1]        -> False
[1,1,1,2],[1,1,2]         -> False

1:  Note that while \$B_n\$ satisfies all the properties of a group the operation on our braid group is not commutative, and thus our group is not abelian.
2: If you would like to verify this for yourself I suggest applying \$\sigma_1^-\$ to both sides, If you draw the two out on paper, or model them with actual strings it should become apparent why this is the case.

I am unfamiliar with braid theory, therefore I am VTCing as utter gibberish (just kidding)

Haskell, 190 bytes
i!j|j<0=reverse$map(0-)$i!(-j)|i==j=[i,i+1,-i]|i+1==j=[i]|i+j==0=[j+1]|i+j==1=[-j,-i,j]
_!j=[j]
j%(k:a)|j+k==0=a
j%a=j:a
i&a=foldr(%)[]$foldr((=<<).(!))[i]a
a?n=map(&a)[1..n]
(a#b)n=a?n==b?n

Try it online!
How it works
Let Fn be the free group on n generators x1, …, xn.  One of the first results in braid theory (Emil Artin, Theorie der Zöpfe, 1925) is that we have an injective homomorphism f : Bn → Aut(Fn) where the action fσi of σi is defined by
fσi(xi) = xixi + 1xi−1,
fσi(xi + 1) = xi,
fσi(xj) = xj for j ∉ {i, i + 1}.
The inverse fσi−1 is given by
fσi−1(xi) = xi + 1,
fσi−1(xi + 1) = xi + 1−1xixi + 1,
fσi−1(xj) = xj for j ∉ {i, i + 1}
and of course composition is given by fab = fa ∘ fb.
To test whether a = b ∈ Bn, it suffices to test that fa(xi) = fb(xi) for all i = 1, …, n.  This is a much simpler problem in Fn, where we only need to know how to cancel xi with xi−1.
In the code:

i!j computes fσi(xj) (where either i or j may be negative, representing an inverse),
foldr(%)[] performs reduction in the free group,
i&a computes fa(xi),
a?n computes [fa(x1), …, fa(xn)],
and (a#b)n is the equality test for a = b in Bn.

Python 2, 270 263 260 250 249 241 bytes
def g(b,i=0):
 while i<len(b)-1:
  R,s=b[i:i+2]
  if R<0<s:b[i:i+2]=[[],[s,-R,-s,R],[s,R]][min(abs(R+s),2)];i=-1
  i+=1
 return b
def f(a,b):
 b=g(a+[-v for v in b][::-1]);i=0
 while i<len(b)and b[0]>0:b=b[1:]+[b[0]];i+=1
 return g(b)==[]

Try it online!
Implementation of the 'subword reversing' method of solving the braid isotopy problem: a=b iff ab^-1 = the identity.
Algorithm taken from: Efficient solutions to the braid isotopy problem, Patrick Dehornoy; he describes several other algorithms which may be of interest...
This algorithm works by marching left to right in the list, searching for a negative number followed by a positive number; i.e., a sub-word of the form xi-1xj with i,j >0.
It uses the following equivalences:
xi-1xj = xjxixj-1xi-1 if i=j+1 or j=i+1
xi-1xj= identity (empty list) if i==j
xi-1xj = xjxi-1 otherwise.
By repeated application, we end up with a list of the form w1 + w2, where every element of w1 is positive and every element of w2 is negative. (This is the action of the function g).
We then apply g a second time to the list w2 + w1; the resulting list should be empty iff the original list was equivalent to the identity.

By Corollary 3.5 of that paper, when applying g for the second time, you can apply it on reverse(w1+w2) instead of w2+w1, which will save a few bytes: Try it online!

Wolfram Language (Mathematica), 110 bytes
!FreeQ[(r=Reverse)[Or@@#||Or@@-r@#2//.(s=i_||j_/;i<0<j:>Switch[i+j,0,1<0,1|-1,j||-i||-j||i,_,j||i])]//.s,1<0]&

Try it online!
A port of Chas Brown's Python answer.

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


text:
Find the Missing Letter
Guidelines
Task
Write a method that takes an array of consecutive (increasing) letters as input and that returns the missing letter in the array (lists in some languages).

Rules

This is code golf so the shortest answer in bytes wins!
You will always get a valid array
There will always be exactly one letter missing
The length of the array will always be at least 2.
The array will always contain letters in only one case (uppercase or lowercase)
You must output in the same case (uppercase or lowercase) that the input is
The array will always only go one letter a time (skipping the missing letter)
The array length will be between 2 and 25
The first or last element of the array will never be missing

Examples
['a','b','c','d','f'] -> 'e'
['O','Q','R','S'] -> 'P'
['x','z'] -> 'y'
['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','w','x','y','z'] -> 'v'

Can I take a string instead?

@LeakyNun Strings are arrays of characters, so yes.

Will the first or the last ever go missing?

@LeakyNun No. I have edited the question to make it clearer.

Can the output be an array containing the missing character (e.g: for the input ['a','b','c','d','f','g'], output ['e'], if that makes the code shorter?

@Mr.Xcoder A string is just an array of characters, so yes

@rahnema1 Completely different, but okay...

Is a full program that reads from standard input and prints to standard output acceptable? And what about an anonymous code block / lambda function? Or a named stand-alone function, for languages that don't have "methods"? Or even just a code snippet that isn't wrapped in a block / lambda / function / method? (Quite a lot of the answers, including mine at the moment, seem to be of this type. In some languages with implicit I/O, such snippets are effectively indistinguishable from full programs.)

Rule four is simply a subset of rule eight and can be removed (at least, if you put the word "inclusive" at the end of rule eight).

This might be more iffy, but is it okay to take an array of bytes?

Pyth, 5 bytes
-rhQe

Try it online!

C# (.NET Core), 48 47 46 bytes, input as char array
s=>{for(int i=0;s[++i]==++s[0];);return s[0];}

Try it online!
Explanation: the first element in the array is incremented as well as a pointer iterating the following elements. When both the first element and the current element are different, it returns the first element.
C# (.NET Core), 58 56 50 bytes, input as string
s=>{var c=s[0];while(s.IndexOf(++c)>=0);return c;}

Try it online!
Previous 58-byte solution (referenced in the first comment):
s=>{for(int i=1;;i++)if(s[i]-s[0]>i)return(char)(s[i]-1);}

Algorithms using System.Linq
The following algorithms must add using System.Linq; (18 bytes) to the byte count and therefore are longer.
I quite liked this one (52+18 bytes):
s=>{int i=0;return(char)(s.First(c=>c-s[0]>i++)-1);}

And you also have a one-liner (45+18)-byte solution:
s=>(char)(s.Where((c,i)=>c-s[0]>i).First()-1)

And a very clever (37+18)-byte solution, courtesy of Ed'ka:
s=>s.Select(e=>++e).Except(s).First()

Won't this fail to compile with not all code paths return a value? But +1 for the comparison check with s[i]-s[0], pretty clever!

@TheLethalCoder It won't fail as the for loop does not have a stop condition, so it will keep iterating until the if condition evaluates to true.

Of course! Nice work.

Turns out the full Linq version is just under double the bytes!

I'm not sure, but if you switched from ++i to i++, you could probably omit <= in favor of <.

@enedil No, I can't, that would not yield the proper results. Try it online!

Can you do (char)--s[i] to save some bytes?

You can save 8 bytes like this: a=>{int i=0;for(;a[++i]-a[0]<=i;);return--a[i];} (when you take the input as char[]). Not thanks to me btw, thanks to @Nevay's comment on my Java 8 answer.

@KevinCruijssen found a way to save two more bytes taking the input as a char array.

Shorter Linq version: s=>s.Select(e=>++e).Except(s).First()

Alice, 10 bytes
/X.
\ior@/

Try it online!
Explanation
This is just a framework for linear programs that operate entirely in Ordinal (string processing) mode:
/...
\.../

The actual linear code is then:
i.rXo@

Which does:
i   Read all input.
.   Duplicate.
r   Range expansion. If adjacent letters don't have adjacent code points, the
    intermediate code points are filled in between them. E.g. "ae" would turn
    into "abcde". For the inputs in this challenge, this will simply insert
    the missing letter.
X   Symmetric set difference. Drops all the letters that appear in both strings,
    i.e. everything except the one that was inserted by the range expansion.
o   Output the result.
@   Terminate the program.

Haskell, 33 30 bytes
f a=until(`notElem`a)succ$a!!0

Try it online!

until saves a byte: f(a:b)=until(`notElem`a:b)succ a

Java 8, 70 57 56 48 46 bytes
a->{for(int i=0;++a[0]==a[++i];);return a[0];}

-14 (70 → 56) and -2 (48 → 46) bytes thanks to @CarlosAlejo.
-8 (56 → 48) bytes thanks to @Nevay.
Explanation:
Try it here.
a->{            // Method with char-array parameter and char return-type
  for(int i=0;  //  Start index-integer at 0 and loop as long as
    ++a[0]      //   the previous character + 1 (by modifying the character at index 0)
    ==a[++i];   //   equals the next character (by raising the index by 1 before checking)
  );            //  End of loop
  return a[0];  //  Return the now modified character at index 0 in the array
}               // End of method

You can use an implicit cast instead of an explicit cast to save 8 bytes a->{int i=0;for(;a[++i]-a[0]<=i;);return--a[i];}.

Ruby, 21 characters
->a{[*a[0]..a[-1]]-a}

Returns a single element array, according to question owner's comment.
Sample run:
irb(main):001:0> ->a{[*a[0]..a[-1]]-a}[['a','b','c','d','f']]
=> ["e"]

Try it online!

C (gcc), 33 35 36 48 60 bytes
All optimizations should be turned off and only on 32-bit GCC.
f(char*v){v=*v+++1-*v?*v-1:f(v);}

Take input as a string.
Try it online!

"All optimizations should be turned off and only on 32-bit GCC." is a very roundabout way of saying this doesn't work (only appears to work due to UB)

I'd say foo(char*a){return*a+1==a[1]?foo(a+1):++*a;} is pretty good; Only 1 char shorter than the more natural foo(char*a){while(*a+1==a[1])a++;return++*a;}

@sehe  constant undefined behavior is considered acceptable on PPCG

Suggest ~*v+++*v instead of *v+++1-*v

Python 3, 74 62 58 44 40 bytes
-12 bytes thanks to Erik the Outgolfer. -18 bytes thanks to Leaky Nun. -4 bytes thanks to musicman523.
Takes input as a bytestring.
lambda s:chr(*{*range(s[0],s[-1])}-{*s})

Try it online!
Another cool solution:
lambda s:chr(*{*range(*s[::~-len(s)])}-{*s})

.difference({*s}) -> -{*s}

60 bytes

44 bytes with bytestring

2 more bytes

Your solution is what I was after but in a far more elegant way

SWI Prolog, 124 bytes
m([H|T]):-n(H,N),c(T,N),!,m(T).
n(I,N):-o(I,C),D is C+1,o(N,D).
c([N|_],N).
c(_,N):-print(N),!,fail.
o(C,O):-char_code(C,O).

Examples:
?- m(['a','b','c','d','f']).
e
false.

?- m(['O','Q','R','S']).
'P'
false.

?- m(['x','z']).
y
false.

?- m(['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','w','x','y','z']).
v
false.

Little explanation:
The m is the "main" procedure,the n produces next expected character in the list. The c does comparison - if expectation matches the next item, continue, else print out expected character and jump out of the window.

Shorter than fail: 0=1.

Mathematica, 46 bytes
Min@Complement[CharacterRange@@#[[{1,-1}]],#]&

I believe that Min@Complement[CharacterRange@@#[[{1,-1}]],#]& would save a byte.

@LegionMammal978 actually 2!

Excel, 110 + 2 = 112 bytes
=CHAR(CODE(LEFT(A1))-1+MATCH(0,IFERROR(FIND(CHAR(ROW(INDIRECT(CODE(LEFT(A1))&":"&CODE(RIGHT(A1))))),A1),0),0))

Must be entered as an array formula (Ctrl+Shift+Enter) which adds curly brackets { } on each end, adding two bytes. Input is as a string in A1, which is OK per OP.
This is not the shortest answer by far (Excel rarely is) but I like seeing if it can be done.

For you to consider if input is an actual array: =XLOOKUP(2,CODE(A2:A5)-CODE(A1:A4),CHAR(CODE(A1:A4)+1)). Depending on an array of just two values (e.g.: =XLOOKUP(2,CODE(A2)-CODE(A1),CHAR(CODE(A1)+1))  this would be 46 bytes. Btw, I'm new to this code-golf community but your Excel-answers are nice to go over. Good work!

@JvdV Good work and I appreciate the appreciation. Excel seems rare around here. XLOOKUP was added in 2019 which is after the question was posted. Those answers are allowed but I'll leave this one up. I encourage you to post that as your own answer, though!

Husk, 6 bytes
→S-(ḣ→

Try it online!
This function takes a string (list of characters) as input, and returns a character as output.
Explanation
→S-(ḣ→
    ḣ→    Get the list of all characters from the null byte to the last character of the input
 S-       Subtract the input from this list
→         Get the last element of the result

JavaScript (ES6), 70 bytes
Input as a character array
(a,p)=>a.some(c=>(q=p+1,p=c.charCodeAt(),p>q))&&String.fromCharCode(q)

Less golfed
a=>{
  p = undefined;
  for(i = 0; c = a[i]; i++)
  {
    q = p+1
    p = c.charCodeAt()
    if (p>q)
      return String.fromCharCode(q)
  }
}

Test

F=(a,p)=>a.some(c=>(q=p+1,p=c.charCodeAt(),p>q))&&String.fromCharCode(q)

function update() {
  var a0=A0.value.charCodeAt()
  var a1=A1.value.charCodeAt()
  if (a1>a0) {
    var r = [...Array(a1-a0+1)]
      .map((x,i)=>String.fromCharCode(a0+i))
      .filter(x => x != AX.value)
    I.textContent = r.join('') + " => " + F(r)
  }
  else {
    I.textContent=''
  }
}

update()
input { width: 1em }
Range from <input id=A0 value='O' pattern='[a-zA-Z]' length=1 oninput='update()'>
to <input id=A1 value='T' pattern='[a-zA-Z]' length=1 oninput='update()'>
excluding <input id=AX value='Q' pattern='[a-zA-Z]' length=1 oninput='update()'>

PHP>=7.1, 46 bytes
Take input as string

<?=trim(join(range(($a=$argn)[0],$a[-1])),$a);

PHP Sandbox Online

Retina, 33 25 bytes
$
¶$_
T`p`_p`.*$
D`.
!`.$

Try it online! Works with any range of ASCII characters. Edit: Saved 8 bytes thanks to @MartinEnder. Explanation: The first stage duplicates the input. The second decreases all of the characters in the copy by 1 code point. The third stage deletes all of the characters in the copy that still appear in the original. This just leaves the original input, the character that precedes the first character of the original input and the missing character. The last stage then just matches the missing character.

Here is 25, using the same basic idea: https://tio.run/##K0otycxL/P9fhevQNpV4rpCEgoT4ggQ9LRUulwQ9LsUEPZX///0DggA (I'm decrementing the second line because that saves a byte and then I'm finding the unique char using deduplication.)

@MartinEnder Deduplication is exactly what I wanted all along, and I already forgot Retina has it, sigh... (I know incrementing the first line takes a byte more than decrementing the second line but it made the match regex shorter.)

C++14, standard library, generic container type (87 86 bytes)
[](auto a){return++*adjacent_find(begin(a),end(a),[](auto a,auto b){return a+1!=b;});}

Container type from namespace ::std is assumed (e.g. std::string, std::list or std::vector. Otherwise using namespace std; or similar would be assumed.

Thanks to @Ven, with a little bit of preprocessor hacking, you get get it down to 82 bytes (1 newline)
#define x [](auto a,int b=0){return++
x *adjacent_find(begin(a),end(a),x a!=b;});}

See it Live On Coliru
C++14 no standard library (still generic, 64 63 bytes)
[](auto& a){auto p=*begin(a);for(auto c:a)if(c!=p++)return--p;}

Again, need to help name lookup only if container type not from namespace ::std (or associated with it)
Live On Coliru for std::string e.g.
Live On Coliru for char const[] e.g.

You need to put a space between the strike-out text and the next text.

@CJDennis Done. By the way, your current rep (2469) is a beautiful number (being 3*823 and also visually paired as (24)(69) which is (2 2 2 3)(3 23))

Jelly, 6 bytes
O‘Ọḟ⁸Ḣ

Try it online!
How it works
O‘Ọḟ⁸Ḣ - Main link. Takes a string S on the left
O      - Convert to char codes
 ‘     - Increment each
  Ọ    - Convert from char codes

         This yields the characters that directly follow each character in S
         Call this C

    ⁸  - Yield S
   ḟ   - Remove the characters from C that are in S
     Ḣ - Return the first one

k, 17 13 bytes
-4 bytes thanks to coltim.
{*(`c$1+x)^x}

Try it online!
Explanation:
{           } /def func(x): # x should be a list of chars
      1+x     /  above  = [ord(c)+1 for c in x]
  (`c$   )    /  above  = [chr(i) for i in above]
          ^x  /  result = [e for e in above if e not in x]
 *            /  return result[0]

I think 4 bytes can be saved (although each function invocation now returns a character instead of a string).

Python 2 - 76 bytes
Loses to existing python 2 solution but it's a slightly different approach so I thought I'd post it anyway:
lambda c:[chr(x)for x in range(ord(c[0]),ord(c[0]+26)if chr(x)not in c][0]

Charcoal, 18 bytes
Ｆγ¿¬∨∨‹ι⌊θ›ι⌈θ№θιι

Try it online! Link is to verbose version of code. Takes input as a string. Works with any almost contiguous sequence of ASCII characters.

Rexx (Regina), 56 bytes
a=arg(1)
say translate(xrange(left(a,1),right(a,1)),'',a)

Try it online!
Finally one that enables REXX to use its strong string-manipulation.

C#, 104 bytes
using System.Linq;a=>(char)Enumerable.Range(a.Min(),a.Max()-a.Min()).Except(a.Select(c=>(int)c)).First()

Full/Formatted version:
using System.Linq;

namespace System
{
    class P
    {
        static void Main()
        {
            Func<char[], char> f = a =>
                (char)Enumerable.Range(a.Min(), a.Max() - a.Min())
                                .Except(a.Select(c=>(int)c))
                                .First();

            Console.WriteLine(f(new[] { 'a', 'b', 'c', 'd', 'f' }));

            Console.ReadLine();
        }
    }
}

A very clever Linq version by Ed'ka: s=>s.Select(e=>++e).Except(s).First()

@CarlosAlejo I saw you added it to your answer so I won't update mine but yes it is very clever. A lot shorter than my version of doing it.

CJam, 6 bytes (full program) / 7 bytes (code block)
q),^W=

Try it online!
This is a full CJam program that reads the input string from standard input and prints the missing letter to standard output.  CJam doesn't actually have "methods", which is what the challenge asks for, but the closest thing would probably be an executable code block, like this:
{),^W=}

Try it online!
This code block, when evaluated, takes the input as a string (i.e. an array of characters) on the stack, and returns the missing character also on the stack.

Explanation: In the full program, q reads the input string and places it on the stack.  ) then pops off the last character of the input string, and the range operator , turns it into an array containing all characters with code points below it (including all letters before it in the alphabet).  Thus, for example, if the input was cdfgh, then after ), the stack would contain the strings cdfg (i.e. the input with the last letter removed) and ...abcdefg, where ... stands for a bunch of characters with ASCII codes below a (i.e. all characters below the removed last input letter).
The symmetric set difference operator ^ then combines these strings into a single string that contains exactly those characters that appear in one of the strings, but not in both.  It preserves the order in which the characters appear in the strings, so for the example input cdfg, the result after ),^ will be ...abe, where ... again stands for a bunch of characters with ASCII codes below a.  Finally, W= just extracts the last character of this string, which is exactly the missing character e that we wanted to find (and discards the rest).  When the program ends, the CJam interpreter implicitly prints out the contents of the stack.

Bonus: GolfScript, 6 bytes (full program)
),^-1>

Try it online!
It turns out that nearly the same code also works in GolfScript.  We save one byte in the full program version due to GolfScript's implicit input, but lose one byte because, unlike CJam's W, GolfScript doesn't have a handy single-letter variable initialized to -1.
Also, CJam has separate integer and character types (and strings are just arrays containing characters), whereas GolfScript only has a single integer type (and has a special string type that behaves somewhat differently from normal arrays).  The result of all this is that, if we want the GolfScript interpreter to print out the actual missing letter instead of its ASCII code number, we need to return a single-character string instead of just the character itself.  Fortunately, making that change here just requires replacing the indexing operator = with the array/string left truncation operator >.
Of course, thanks to GolfScript's implicit I/O, the code above can also be used as a snippet that reads a string from the stack and returns a single-character string containing the missing letter.  Or, rather, any snippet that takes a single string on the stack as an argument, and returns its output as a printable string on the stack, is also a full GolfScript program.

Code snippets are not allowed by default; only functions and full programs are. So you probably need that q (program), or {...} (block). +1 for the approach though

This is very clever!

JavaScript (ES6), 64 bytes
Takes input as a string.
s=>(g=p=>(c=String.fromCharCode(n++))<s[p]?p?c:g(p):g(p+1))(n=0)

How?

Initialization: We start with n = 0 and p = 0 and call the recursive function g().
g = p =>                                   // given p
  (c = String.fromCharCode(n++)) < s[p] ?  // if the next char. c is not equal to s[p]:
    p ?                                    //   if p is not equal to zero:
      c                                    //     step #3
    :                                      //   else:
      g(p)                                 //     step #1
  :                                        // else:
    g(p + 1)                               //   step #2

Step #1: We increment n until c = String.fromCharCode(n) is equal to the first character of the input string s[0].
Step #2: Now that we're synchronized, we increment both n and p at the same time until c = String.fromCharCode(n) is not equal to s[p] anymore.
Step #3: We return c: the expected character which was not found.

Test cases

let f =

s=>(g=p=>(c=String.fromCharCode(n++))<s[p]?p?c:g(p):g(p+1))(n=0)

console.log(f('abcdf'))                     // -> 'e'
console.log(f('OQRS'))                      // -> 'P'
console.log(f('xz'))                        // -> 'y'
console.log(f('abcdefghijklmnopqrstuwxyz')) // -> 'v'

APL (Dyalog), 17 bytes
(⊃⎕AV/⍨∨\∧~)⎕AV∘∊

Try it online!
⎕AV∘∊ Boolean: each character in the Atomic Vector (character set) member of the argument?
(…) apply the following tacit function:
 ⊃ the first element of
 ⎕AV the Atomic Vector (the character set)
 /⍨ which
 ∨\ follows the initial (member of the argument)
 ∧ but
 ~ is not (a member of the argument)

MATL, 8 7 bytes
1 byte saved thanks to @Luis
tdqf)Qc

Try it at MATL Online
Explanation
      % Implicitly grab the input as a string
t     % Duplicate the string
d     % Compute the differences between successive characters
q     % Subtract 1 from each element
f     % Get the locations of all non-zero characters (1-based index)
)     % Extract that character from the string
Q     % Add one to get the next character (the missing one)
c     % Convert to character and display

Python 3, 42 bytes
f=lambda a,*r:r[0]-a>1and chr(a+1)or f(*r)

Try it online!
Uses unpacked bytestring as input: f(*b'OQRS')

Husk, 3 bytes
-¹…

Try it online!
I'm slightly nervous about posting this, as it seems wierd to beat all other answers (including one in Husk) by such a significant margin...  but it seems to work for the test cases, at least...
How?
-       # output elements that are different between:
 ¹      # 1. the input list, and
  …     # 2. the input list, with all the gaps filled
        #    with the missing character ranges

yep, it's alright. I thought APL extended had a similar answer, but looks like it's rangify doesn't work with characters.

Arturo, 21 bytes
$->s[--@s\0..last<=s]

Try it!
$->s[            ; a function taking an argument s
    <=s          ; duplicate s
    last         ; last letter in s
    ..           ; range
    s\0          ; first letter in s
    @            ; reify range
    --           ; set difference (between the range and duplicated s)
]                ; end function

Could you post an explanation for this?

@south Affirmative!

Not what I was expecting. Love it, Arturo looks very cool.

Japt, 14 bytes
mc
g oUo¹kU md

Try it online!

PHP, 44 bytes
operating on separate command line arguments:
for($c=$argv[1];++$c==$argv[-~++$i];)echo$c;            # 44 bytes
for($c=$argv[$i=1];++$c==$argv[++$i];)echo$c;           # 45 bytes
<?=end(array_diff(range($argv[1],end($argv)),$argv));   # 53 bytes
<?=trim(join(range($argv[1],end($argv))),join($argv));  # 54 bytes

Brain-Flak, 45 bytes
{([{}()]({})){{}({}<>)((<()>))}{}}{}({}[()])

Try it online!
44 bytes of code, and +1 byte for the -c flag.
Surprisingly short for a language terrible at manipulating strings.

Python 3, 92 bytes
from string import *; f=lambda s:{*[a for a in ascii_letters if a>=s[0] and a<=s[-1] ]}^{*s}

Try it online!
Long solution but I like how sets work, and it seemed shorter in my head.

R, 67 bytes
l=letters;L=LETTERS;a=scan(,'');`if`(a==l&&T,l[a!=l][1],L[a!=L][1])

Try it online!

this only works if the first letter of the array is 'a' because if by default only checks the first value of the array!

@Giuseppe Hmm.. Now when I am looking at my code that I wrote a day ago, I am not sure what I meant when checking if a==l&&T is true :) Thanks for pointing out the mistake!

Jelly, 7 bytes
.ịOr/Ọḟ

Try it online!

05AB1E, 9 7 bytes
Ç¤ÝsKçθ

Try it online!

I'm going to judge from the 2 that we're using the same algorithm, even though I hardly know 05AB1E :)

@LeakyNun Well, I thought of the algorithm too...

I just changed my algorithm though.

@LeakyNun It'd be longer in 05AB1E anyways.

I just thought of another algorithm that contains 2, might be yours...

@LeakyNun Nah as I said above it's the deltas thingy.

ES6, 125 bytes:
(a=>((s,f)=>(r=(i,b)=>a[i]?r(i+1,b||(s[f](i)-s[f](i-1)-1&&String.fromCharCode(s[f](i-1)+1))):b)(1,0))(a.join(""),"charCodeAt"))

http://jsbin.com/vasoqidawe/edit?console
The returned function needs to be called with an array
(["a","c"])

one could save another 9 bytes through removing .join("") and passing a string:
("ac")

ES6, 108 bytes:
(a=>((s,f,o)=>(a.find((_,i)=>(o?++o:o=s[f](i))!==s[f](i)),String.fromCharCode(o)))(a.join(""),'charCodeAt'),0))

http://jsbin.com/tudiribiye/edit?console

bind ??? in code golf ?

@edc65 whats wrong with it ? ( sorry if this is n00b, but thats my first golf :))

@edc65 but youre probably right, removing it saved 4 bytes...

a.join("") could be a.join``

J, 20 bytes
{&a.>:I.1 0 1&E.a.e.

a.e. boolean mask for the input letters across ascii charset
1 0 1&E. new boolean mask indicating if the sequence 101 begins at that index, ie, find any place a "skip" sequence begins
I. the index of that match, ie, the character before the skipped one
>: increment by 1, ie, the index of the skipped char within ascii charset
{&a. pick that index from the ascii charset, ie, return the skipped char

Try it online!

That looks like a snippet to me.

@Adám It's written in a tacit (point-free) style, which I believe counts as "function-like" as opposed to a snippet. As best as I can tell, it's no more of a snippet than your APL solution is (but I do not know dyalog, so take what I say with a grain of salt).

@Adám yes it is, in the sense that it can’t be assigned to a variable but assumes input on its right side.  is this not legal?  i asked about it somewhere and was told it was fine

My understanding for APL/J/K is that the code must be able to reside in a name, whether by assignment or as the body an explicit verb/function (however, the explicit form must then have explicit input too). Snippet is code which assumes values in variables and/or needs pasting into a line, but cannot stand on their own.

@zgrep No, this code is explicit (non-tacit), but is missing the reference to its argument on the far right. My APL function is a complete tacit function which can assigned or put in a parenthesis.

@Adám noted, thx.  sort of unfortunate rule for J but Ill keep it in mind going forward

@Adám Oh. So I see. You make a fair and valid point.

19: ({.@-.~>:)&.(a.&i.)

@Ed'ka very nice!

Common Lisp, 88 bytes
(lambda(s)(loop as(x y)on s if(>(#1=char-code y)(1+(#1#x)))return(code-char(1+(#1#x)))))

Try it online!

Python 2, 69 bytes
lambda a:chr((ord(a[0])+ord(a[-1]))*-~len(a)/2-sum(ord(x)for x in a))

Try it online!
Some explanations As we know the first and the last elements of the list, we can easily compute the sum of the codes of all the chars in the list + the missed char (using summary formulas of arithmetic progression). The difference between this sum and the sum of the codes of all the chars in the list gives the code of the missed letter.

PHP, 43 bytes
for($x=$argn[0];$argn[++$i]==++$x;);echo$x;

For those curious to try this: the code expects a single string on STDIN.

Doesn't php need <? to switch from echoing the input to running real code?

Scala, 63 chars, 63 bytes
for(i<-1 to t.size-1)if(t(i-1)+1!=t(i))return (t(i)-1).toChar
0

See TIO link for tests. t is the input (a String), and I output a char.
I tried doing it with a string (like this) but I don't think it is correct to output the code of the missing char. This would make the code 3 bytes shorter.
Try It Online!

05AB1E, 5 bytes
ÇŸçsK

Uses the 05AB1E encoding. Try it online!

You're supposed to just return the missing character :P.

ÇŸçsSK works though.

x86 Machine Code, 11 bytes
8A 11
41
8A 01
48
38 C2
74 F6
C3

The above bytes define a function in 32-bit x86 machine code that finds the missing letter. It takes a single parameter, which is a pointer to the first element of a character array. (The length of the array is not needed, and the character array need not be NUL-terminated.)
The function uses the fastcall calling convention, where its parameter is passed in the ECX register. (It isn't essential that this calling convention or ECX be used for the input; we just need a register-based calling convention. You could trivially modify the code to take input in any register.)
The return value (the missing character) is returned in the AL register (low byte of EAX).
Note that characters are assumed to be 1 byte in length. This is perfectly sufficient for 8-bit ASCII characters, but is obviously not guaranteed to work on Unicode characters. The challenge doesn't specify, and the sample inputs only show basic ASCII. The whole world is ASCII, right?
Ungolfed assembly mnemonics:
; char FindMissingChar(char *letters);
Top:
    mov     dl, BYTE PTR [ecx]    ; load nth character from array
    inc     ecx                   ; increment pointer
    mov     al, BYTE PTR [ecx]    ; load n+1th character from array
    dec     eax                   ; decrement AL (shorter than 'dec al')
    cmp     dl, al                ; compare these two characters
    je      L2                    ; keep looping if n+1 is the char expected to follow n
    ret                           ; otherwise, return with the missing character in AL

Try it online!
(The TIO link passes the -m32 switch to GCC to ensure that it is compiling in 32-bit mode, and also applies an attribute to ensure the compiler uses the correct calling convention.)

><>, 12 bytes
i/o;
?/1+:i-

Try it online!
Explanation
i/o;
?/1+:i-

i/            | Push 1 byte input to the stack then move to second line
 /1+:         | Add 1 to the stack top then duplicate it
     i-       | Push 1 byte input and take from the stack top
?/            | Check stack top is 0, if not 0 move back to line 1
 /o;          | Print the stack top

Octave, 34 32 bytes
@(x)char(setdiff(x(1):max(x),x))

Anonymous function; returns the missing character.
Try it online!

8th, 99 bytes
Rationale
If the distance between letters is greater than two, then there is a missing letter. Letter distance is obtained by computing the difference between ASCII code of each letter.
Code
: f ' nip s:each repeat over n:- 2 n:= if n:1+ "" swap s:+ . reset 1 then depth n:1- while! reset ;

Ungolfed version
: f \ s -- c
  ' nip s:each    \ convert each letter into its ASCII code and put them on stack
  repeat
    over
    n:- 2 n:=     \ check if there is a missing letter
    if
      n:1+        \ compute the ASCII code of missing letter
      "" swap s:+ \ convert ASCII code into printable character
      .           \ print out the missing letter
      reset 1     \ set condition to exit from while!
    then
    depth n:1-    \ verify if there are letters to check
  while!
  reset           \ clean stack
;

Usage and examples
ok> "abcdf" f
e
ok> "OQRS" f
P
ok> "xz" f
y
ok> "abcdefghijklmnopqrstuwxyz" f
v
ok> "ab" f

ok> "def" f

ok>

Clojure, 102 89 bytes
#(nth(filter(fn[a](not(some #{a}%)))(map char(range(int(first %))(inc(int(last %)))))) 0)

Anonymous function, takes a string as parameter and returns the first missing character.
Seems like clojure ain't that good for golfin'...
Edit: Stripped whitespace and used nth ... 0 instead of first

Japt -h, 6 bytes
â¡Îc+Y

Try it
â¡Îc+Y     :Implicit input of array U
â          :Setwise union with
 ¡         :Map each 0-based index Y in U
  Î        :  First element of U
   c       :  Codepoint
    +Y     :  Add Y
           :Implicit output of last element

Python 3, 62 bytes
Outgolfed, but has a clean string interface :)
def f(s,i=0):a=chr(ord(s[0])+i);return a==s[i]and f(s,i+1)or a

Try it online!

Factor + math.unicode, 29 bytes
[ dup minmax [a,b] swap ∖ ]

Try it online!

PowerShell Core, 36 bytes
param($a)$a[0]..$a[-1]|?{$_-notin$a}

Try it online!
Takes the chars as an array of strings
$a[0]..$a[-1]  # creates a range from the first to the last character in the argument
|?{$_-notin$a} # keeps only the character that is not in the argument

J, 18 bytes
{.@(>:-.])&.(3&u:)

Same approach as many others.
Try it online!
{.@(>:-.])&.(3&u:)
            (3&u:)  NB. convert to char codes
    >:              NB. increment
        ]           NB. input
      -.            NB. set difference
  @                 NB. then
{.                  NB. take the head
          &.        NB. lastly, perform the inverse of 3&u:, which converts back to char

Mathematica, 83 bytes
T=ToCharacterCode;FromCharacterCode[T@#[[Position[Differences@T@#,{2}][[1,1]]]]+1]&

input

[{"a","b","c","d","f"}]

Perl, 39 bytes
33 bytes code + 6 for -nalF.
print grep"@F"!~$_,$F[0]..$F[$#F]

Explanation
Creates a list of first character to last character and strips out any items that exist in the source string.
Try it online!

J,30 bytes - till I can get rid of more parentheses!
a.{~((([:i.#)+/a.i.{.)-.a.i.])       'abcef'

Returns d
 a.{~     take from
 ((([:i.#) number of input bytes
 +/a.i.{.) starting from 2nd input byte
 -.a.i.]) subtract all but missing character from input

Or, a byte longer (31), completely different method but perhaps more elegantly?
a.{~<:a.i.t#~0,~<:2-/\a.i.t=:|.           'STUVX'

    returns W

const missed=ar=>String.fromCharCode(ar.reduce((a,v)=>a+1!==v.charCodeAt()?a:v.charCodeAt(),ar[0].charCodeAt())+1)

Hello, and welcome to PPCG! What language is this, and how many bytes? If you don't know the bytes, I'm here to help. Just type @NoOneIsHere, and your question, into a comment.

Welcome to PPCG! Here are a few tips to help you: You should use 'f' for the name of an functions or variables as it reduces bytes. Also, you should add the language and the byte count above your code. If I am correct, this is Java?

Vyxal g, 5 bytes
C›C?F

Try it Online!
Explanation
C›C?F  # Implicit input
C      # Convert to charcodes
 ›     # Increment
  C    # Convert from charcodes
   ?F  # Remove elements which are in the input
       # g flag gets minimum (first) element

Thunno 2 BM, 3 bytes
⁺$ṗ

Attempt This Online!
Port of my Vyxal answer.
Explanation
⁺$ṗ  # Implicit input, converted to ordinals by B flag
⁺    # Increment each ordinal in the list
 $   # Push the input (as an ordinal list) again
  ṗ  # Set difference between the incremented and original lists
     # Implicit output of minimum ordinal as a character

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