text:
Generate ASCII Art
Given a black-and-white image in any reasonable lossless format as input, output ASCII art that is as close to the input image as possible.
Rules

Only linefeeds and ASCII bytes 32-127 may be used.
The input image will be cropped so that there is no extraneous whitespace surrounding the image.
Submissions must be able to complete the entire scoring corpus in under 5 minutes.
Only raw text is acceptable; no rich text formats.
The font used in the scoring is 20-pt Linux Libertine.
The output text file, when converted to an image as described below, must be the same dimensions as the input image, within 30 pixels in either dimension.

Scoring
These images will be used for scoring:

You can download a zipfile of the images here.
Submissions should not be optimized for this corpus; rather, they should work for any 8 black-and-white images of similar dimensions. I reserve the right to change the images in the corpus if I suspect submissions are being optimized for these specific images.
The scoring will be performed via this script:
#!/usr/bin/env python
from __future__ import print_function
from __future__ import division
# modified from http://stackoverflow.com/a/29775654/2508324
# requires Linux Libertine fonts - get them at https://sourceforge.net/projects/linuxlibertine/files/linuxlibertine/5.3.0/
# requires dssim - get it at https://github.com/pornel/dssim
import PIL
import PIL.Image
import PIL.ImageFont
import PIL.ImageOps
import PIL.ImageDraw
import pathlib
import os
import subprocess
import sys

PIXEL_ON = 0  # PIL color to use for "on"
PIXEL_OFF = 255  # PIL color to use for "off"

def dssim_score(src_path, image_path):
    out = subprocess.check_output(['dssim', src_path, image_path])
    return float(out.split()[0])

def text_image(text_path):
    """Convert text file to a grayscale image with black characters on a white background.

    arguments:
    text_path - the content of this file will be converted to an image
    """
    grayscale = 'L'
    # parse the file into lines
    with open(str(text_path)) as text_file:  # can throw FileNotFoundError
        lines = tuple(l.rstrip() for l in text_file.readlines())

    # choose a font (you can see more detail in my library on github)
    large_font = 20  # get better resolution with larger size
    if os.name == 'posix':
        font_path = '/usr/share/fonts/linux-libertine/LinLibertineO.otf'
    else:
        font_path = 'LinLibertine_DRah.ttf'
    try:
        font = PIL.ImageFont.truetype(font_path, size=large_font)
    except IOError:
        print('Could not use Libertine font, exiting...')
        exit()

    # make the background image based on the combination of font and lines
    pt2px = lambda pt: int(round(pt * 96.0 / 72))  # convert points to pixels
    max_width_line = max(lines, key=lambda s: font.getsize(s)[0])
    # max height is adjusted down because it's too large visually for spacing
    test_string = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
    max_height = pt2px(font.getsize(test_string)[1])
    max_width = pt2px(font.getsize(max_width_line)[0])
    height = max_height * len(lines)  # perfect or a little oversized
    width = int(round(max_width + 40))  # a little oversized
    image = PIL.Image.new(grayscale, (width, height), color=PIXEL_OFF)
    draw = PIL.ImageDraw.Draw(image)

    # draw each line of text
    vertical_position = 5
    horizontal_position = 5
    line_spacing = int(round(max_height * 0.8))  # reduced spacing seems better
    for line in lines:
        draw.text((horizontal_position, vertical_position),
                  line, fill=PIXEL_ON, font=font)
        vertical_position += line_spacing
    # crop the text
    c_box = PIL.ImageOps.invert(image).getbbox()
    image = image.crop(c_box)
    return image

if __name__ == '__main__':
    compare_dir = pathlib.PurePath(sys.argv[1])
    corpus_dir = pathlib.PurePath(sys.argv[2])
    images = []
    scores = []
    for txtfile in os.listdir(str(compare_dir)):
        fname = pathlib.PurePath(sys.argv[1]).joinpath(txtfile)
        if fname.suffix != '.txt':
            continue
        imgpath = fname.with_suffix('.png')
        corpname = corpus_dir.joinpath(imgpath.name)
        img = text_image(str(fname))
        corpimg = PIL.Image.open(str(corpname))
        img = img.resize(corpimg.size, PIL.Image.LANCZOS)
        corpimg.close()
        img.save(str(imgpath), 'png')
        img.close()
        images.append(str(imgpath))
        score = dssim_score(str(corpname), str(imgpath))
        print('{}: {}'.format(corpname, score))
        scores.append(score)
    print('Score: {}'.format(sum(scores)/len(scores)))

The scoring process:

Run the submission for each corpus image, outputting the results to .txt files with the same stem as the corpus file (done manually).
Convert each text file to a PNG image, using 20-point font, cropping out whitespace.
Resize the result image to the dimensions of the original image using Lanczos resampling.
Compare each text image with the original image using dssim.
Output the dssim score for each text file.
Output the average score.

Structural Similarity (the metric by which dssim calculates scores) is a metric based on human vision and object identification in images. To put it plainly: if two images look similar to humans, they will (probably) have a low score from dssim.
The winning submission will be the submission with the lowest average score.
related

"Black and white" as in "zero/one" or how many gray levels?

@DonMuesli 0 and 1.

Could you clarify what you mean by "Outputting the results to .txt files"? Should the program output text that will get piped to a file or should we output a file directly?

@DanTheMan Either is acceptable. If you output to STDOUT, the output will need to be redirected into a file for scoring purposes, though.

Shouldn't you specify resolution constraints?  Otherwise, we  could produce, say,  a 10000 by 10000 character image that, when, scaled down, would match the original images quite closely, and the individual characters would be illegible dots.  Font-size does not matter if the output image is huge.

@DavidC Good point - I thought that would be implied, but making it explicit is good.

Java, score 0.57058675
This is actually my first time doing image manipulation so it's kind of awkward but I think it turned out OK.
I couldn't get dssim to work on my machine, but I was able to make images using PIL.
Interestingly, the font tells me in Java that each of the characters I'm using are width 6. You can see that in my program FontMetrics::charWidth is 6 for all characters that I have used. The {} logo looks pretty decent in a monospace font. But for some reason the lines do not actually line up in the full text file. I blame ligatures. (And yes, I should be using the correct font.)
In monospaced font:
                                                                                .
                         .,:ff:,                                                   ,:fff::,.
                ,ff .fIIIIIf,                                                         .:fIIIIIf.:f:.
            .,:III: ,ff::                       ..,,            ,,..                      ,:fff, IIII.,
          :IIf,f:,:fff:,                  .:fIIIIIII.          .IIIIIIIf:.                 .,:fff:,ff IIf,
       ,.fIIIf,:ffff,                   ,IIIIIII:,,.            .,,:IIIIIII.                  .:ffff:,IIII,:.
     ,III.::.,,,,,.                     IIIIII:                      ,IIIIII                     ,,,,,.,:,:IIf
     IIIII :ffIIf,                      IIIIII,                      .IIIIII                      :IIIf:,.IIIIf.
  ,II,fIf.:::,..                        IIIIII,                      .IIIIII                       ..,:::,,If::II
  IIIIf.  ,:fII:                       .IIIIII,                      .IIIIII.                       IIff:.  :IIII:
 ::IIIIf:IIIf: .                  ,::fIIIIIII,                        ,fIIIIIIf::,                   ,ffIII,IIIIf,,
:IIf:::    .,fI:                  IIIIIIIII:                            :IIIIIIIIf                  If:,    .::fIIf
 IIIIII, :IIIIf                     .,:IIIIIIf                        fIIIIII:,.                    ,IIIII. fIIIII:
 ,:IIIII ff:,   f,                      IIIIII,                      .IIIIII                      f.  .::f::IIIIf,.
 fIf::,,     ,fIII                      IIIIII,                      .IIIIII                     :III:      ,,:fII.
  fIIIIIIf, :IIIIf   ,                  IIIIII,                      .IIIIII                 .,  ,IIIII. :fIIIIII,
   .:IIIIIII,ff,    :II:                IIIIIIf                      fIIIIII               .fII.   .:ff:IIIIIIf,
     :fffff:,      IIIIIf   ,            :IIIIIIIfff            fffIIIIIII:           ..   IIIII:      ::fffff,
      .fIIIIIIIf:, fIIII,   ,IIf,           ,:ffIIII.          .IIIIff:,          .:fII    fIIII,.:ffIIIIIII:
         ,fIIIIIIIIIf:,     ,IIIII:  .,::,                               .,::,  .IIIIII      ::fIIIIIIIIf:.
             :fffffff,      .fIIIII,   .IIIIIf:                     ,:fIIII:    IIIIII:       :fffffff,
              .:fIIIIIIIIIIIIffffI:      IIIIIIII.                :IIIIIII:     .fIffffIIIIIIIIIIII:,
                   ,:fIIIIIIIIIIIf,       .:fIIIII               ,IIIIIf,        :IIIIIIIIIIIff,.
                         .:ffffffffIIIIIIIIIIIfff:.              ,ffffIIIIIIIIIIIfffffff:,
                             .,:ffIIIIIIIIIIIIIIIIf,   .,,,,.  .:fIIIIIIIIIIIIIIIIff:,.
                                       ....... .,,:fffff:.,:fffff:,.  .......
                                    ..,,:fffIIIIf:,.            .,:fIIIIff::,,..
                                   .IIIIIf:,.                          .,:fIIIII
                                     f,                                      ,f

After running it through the image tool:

Anyway, here's the actual code.
//package cad97;

import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.Rectangle;
import java.awt.Toolkit;
import java.awt.image.BufferedImage;
import java.awt.image.Raster;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
import java.util.Map;
import javax.imageio.ImageIO;

public final class AsciiArt {

    private static final Font LINUX_LIBERTINE = new Font("LinLibertine_DRah", Font.PLAIN, 20);
    private static final FontMetrics LL_METRICS = Toolkit.getDefaultToolkit().getFontMetrics(LINUX_LIBERTINE);
    // Toolkit::getFontMetrics is deprecated, but that's the only way to get FontMetrics without an explicit Graphics environment.
    // If there's a better way to get the widths of characters, please tell me.

    public static void main(String[] args) throws IOException {
        File jar = new java.io.File(AsciiArt.class.getProtectionDomain().getCodeSource().getLocation().getPath());
        if (args.length != 1) {
            String jarName = jar.getName();
            System.out.println("Usage: java -jar " + jarName + " file");
        } else {
            File image = new File(args[0]);
            try (InputStream input = new FileInputStream(image)) {
                String art = createAsciiArt(ImageIO.read(input), LINUX_LIBERTINE, LL_METRICS);
                System.out.print(art); // If you want to save as a file, change this.
            } catch (FileNotFoundException fnfe) {
                System.out.println("Unable to find file " + image + ".");
                System.out.println("Please note that you need to pass the full file path.");
            }
        }
    }

    private static String createAsciiArt(BufferedImage image, Font font, FontMetrics metrics) {
        final int height = metrics.getHeight();
        final Map<Character,Integer> width = new HashMap<>();
        for (char c=32; c<127; c++) { width.put(c, metrics.charWidth(c)); }

        StringBuilder art = new StringBuilder();

        for (int i=0; i<=image.getHeight(); i+=height) {
            final int tempHeight = Math.min(height, image.getHeight()-i);
            art.append(createAsciiLine(image.getSubimage(0, i, image.getWidth(), tempHeight), width));
        }

        return art.toString();
    }

    private static String createAsciiLine(BufferedImage image, Map<Character,Integer> charWidth) {
        if (image.getWidth()<6) return "\n";
        /*
        I'm passing in the charWidth Map because I could use it, and probably a later revision if I
        come back to this will actually use non-6-pixel-wide characters. As is, I'm only using the
        6-pixel-wide characters for simplicity. They are those in this set: { !,./:;I[\]ft|}
        */
        assert charWidth.get(' ') == 6; assert charWidth.get('!') == 6;
        assert charWidth.get(',') == 6; assert charWidth.get('.') == 6;
        assert charWidth.get('/') == 6; assert charWidth.get(':') == 6;
        assert charWidth.get(';') == 6; assert charWidth.get('I') == 6;
        assert charWidth.get('[') == 6; assert charWidth.get('\\') == 6;
        assert charWidth.get(']') == 6; assert charWidth.get('f') == 6;
        assert charWidth.get('t') == 6; assert charWidth.get('|') == 6;

        // Measure whiteness of 6-pixel-wide sample
        Raster sample = image.getData(new Rectangle(6, image.getHeight()));
        int whiteCount = 0;
        for (int x=sample.getMinX(); x<sample.getMinX()+sample.getWidth(); x++) {
            for (int y=sample.getMinY(); y<sample.getMinY()+sample.getHeight(); y++) {
                int pixel = sample.getPixel(x, y, new int[1])[0];
                whiteCount += pixel==1?0:1;
            }
        }

        char next;

        int area = sample.getWidth()*sample.getHeight();

        if (whiteCount > area*0.9) {
            next = ' ';
        } else if (whiteCount > area*0.8) {
            next = '.';
        } else if (whiteCount > area*0.65) {
            next = ',';
        } else if (whiteCount > area*0.5) {
            next = ':';
        } else if (whiteCount > area*0.3) {
            next = 'f';
        } else {
            next = 'I';
        }

        return next + createAsciiLine(image.getSubimage(charWidth.get(','), 0, image.getWidth()-sample.getWidth(), image.getHeight()), charWidth);
    }

}

Compile:

Make sure you have the JDK installed
Make sure that the JDK bin is on your PATH (for me it's C:\Program Files\Java\jdk1.8.0_91\bin)
Save the file as AsciiArt.java
javac AsciiArt.java
jar cvfe WhateverNameYouWant.jar AsciiArt AsciiArt.class

Usage: java -jar WhateverNameYouWant.jar C:\full\file\path.png, prints to STDOUT
REQUIRES the source file to be saved with 1-bit depth and the sample for a white pixel to be 1.
Scoring output:
corp/board.png: 0.6384
corp/Doppelspalt.png: 0.605746
corp/down.png: 1.012326
corp/img2.png: 0.528794
corp/pcgm.png: 0.243618
corp/peng.png: 0.440982
corp/phi.png: 0.929552
corp/text2image.png: 0.165276
Score: 0.57058675

Run with -ea to enable assertions. It won't change the behavior (except maybe slow it down a small amount) because assertions work by failing the program when they evaluate to false and all these assertions pass.

Ahh, I missed that you removed the package declaration. It works now. I'll score it when I get a few minutes today.

The output for board.png is only 4 lines long for some reason: https://gist.github.com/Mego/75eccefe555a81bde6022d7eade1424f. In fact, all of the output seems to be prematurely truncated when I run it, with the exception of the PPCG logo.

@Mego I think it has to do with the height of the font (24 px by the FontMetrics report). I changed the line loop so it errs on the side of one too many lines rather than one too few, and it should work now. (board is 5 lines)

Just as a rule this algorithm struggles with the smaller images, since (it thinks) all of the characters are 6px wide and 24px tall, and all it looks at are how many pixels are turned on in that super-pixel.

I've edited in your score.


text:
Graduation Meme Tally
Now that we're graduating, it's time to tally up the number of times someone suggested that PPCG was graduating, even before the annoucement! (see here)
Your program will receive a list of chat messages. Each message has three pieces of data: the user (e.g. Geobits), the timestamp (e.g. Aug 19 '15 2:41 PM), and the message (e.g. What do you mean "fake"? It clearly says we're graduating in September.). The list will be in no particular order.
The timestamp will be presented in the format that the StackExchange chat search uses:

If the date is in the current year, the date will be of the format: %b %-d %-I:%M %p

%b = three-character month (one of Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec)
%-d = day of month, no padding
%-I = hour (12-hour clock), no padding
%M = minute, padded to two characters with zero
%p = AM or PM

For example, you might have Feb 13 8:09 PM or Mar 8 1:32 AM.
If the date is in another year, the date will be of the format: %b %-d '%y %-I:%M %p

Same as above, with %y = two digit year, padded to two characters with zero

For example, you might have Aug 29 '13 12:02 PM or May 11 '15 11:11 AM.

All dates are in UTC.
You may take input in whatever format you wish (array parameter, string delimited with newline, etc.) as long as the date is still in the format listed above. You may take the current year as an input if your language does not provide any mechanism for fetching the year.
A message is considered to talk about PPCG's graduation if it contains at least one of: graduate, graduated, graduating, or graduation, and contains either we or PPCG. All matches should be case-insensitive, and should not be part of another word: extra letters are not allowed either directly before or after the match (so wegraduate is invalid). Note that we graduate., 3graduate we, and Graduation PPCG! are all valid matches.
Graduation was announced on February 23, 2016 at 16:54:15 UTC. Therefore, any message sent after this date (starting with Feb 23 4:55 PM) should be excluded.
Furthermore, there are some messages that suggest that PPCG is not graduating. These, of course, should be excluded. Therefore, any message containing an odd number of the following should be excluded: not, never, won't, aren't, wont, arent. Once again, these must not be part of another word (see above) and matches should be case-insensitive.
Your program should output a list of all the users with at least one message suggesting our graduation ahead of time, as well as the number of such messages for each user. This list should be sorted by count in descending order. In the case of multiple users with the same number of messages, any of the users may appear first.
Example
Input:
Lines starting with // are not part of the input, and are only present for explanatory purposes.
// does not count, missing we or PPCG
Geobits
Sep 26 '14 4:44 PM
If that's the justification for keeping it beta, then I assume it will graduate as soon as Howard hits 20k?
// counts
Downgoat
Feb 13 8:09 PM
Also, now that we've reached 10Q/D are we graduating?
// does not count, has one not
Geobits
Sep 26 '14 5:10 PM
Yea, sorry. We're not graduating. I'm going to assume from now on that Oct 1 is the southern hemisphere's April Fool's Day.
// counts
Rainbolt
Mar 31 '15 2:36 PM
It also works when we graduate
Alex A.
// does not count, missing we or PPCG
Jan 12 9:01 PM
Watch lies.se graduate before us
// counts
Geobits
Sep 15 '15 5:59 PM
When we graduate in November.
// counts
Geobits
Feb 19 3:41 AM
Maybe we'll graduate tonight and it'll jump to 3k.
// counts
PhiNotPi
Oct 2 '14 1:26 PM
I heard some weird rumor that we are graduating soon. Is there any truth to that?
// does not count, posted after annoucement
Geobits
Feb 23 6:40 PM
I guess we have to graduate this one now:
// does not count, missing we or PPCG
Runer112
Mar 31 '15 4:01 PM
rainbolt, flag at start of each graduate?
// counts
Duck
Nov 11 '14 11:05 AM
We aren't not graduating soon.
// counts
Geobits
Mar 3 '15 2:32 PM
That's why we don't have a logo yet (until we graduate in May). We don't trust the internet.
// counts (not is part of cannot, and is not considered)
user-1
Apr 1 '14 10:05 PM
We cannot graduate.

Output:
Format may vary. You may use any delimiter, or return an array, etc.
Geobits - 3
Downgoat - 1
Rainbolt - 1
PhiNotPi - 1
Duck - 1
user-1 - 1

So the matching of won't, never, ... is case-sensitive?

@DenkerAffe it's case-insensitive, added to main question

Voting to close because things like "part of another word" are not clear. It isn't specified whether things like graduated10, we_graduated, wont', won't'othertext, or Graduation-PPCG would be valid.

Python 2, 569 491 bytes
def g(a):t=filter(lambda m:m[1]<datetime(2016,2,23,4,55)and search(r"\bgraduat(e|ing|ion)\b",m[2],2)and search(r"\bwe|ppcg\b",m[2],2)and len(findall(r"\b(never|(no|won'|aren'|won|aren)t)\b",m[2],2))%2-1,[[m[0],datetime.strptime(m[1],"%b %d '%y %H:%M %p"),m[2]]for m in [[m[0],sub(r"(\w{3} \d\d+)(.*)",r"\1 '%s\2"%str(datetime.now().year)[2:],m[1])if len(m[1])<17else m[1],m[2]]for m in a]]);print sorted([[u,len(filter(lambda m:m[0]==u,t))]for u in set([m[0]for m in t])],key=lambda u:-u[1])

Ungolfed version and demonstration here!
Gonna try to golf this down laterGolfed it down a bit, especially the regex part (I gotta get this into one regex) but I am too noob to optimize the regexes :(

\b(never|(no|((wo|are)n'?))t)\b saves 5 bytes, I think

source: Stack Exchange

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

sort: votes


text:
Difference from liquid to solid items
A shape's volume is the measure of how much three-dimensional space that shape occupies.
Challenge
Given six integers: [L,W,H] as length, width and height of one container and [l,w,h] as length, width and height of some random item.
You will need to calculate how many items would fit completely if the item was a liquid/fluid... and subtract how many items would also fit completely if the item was solid.
Note: Rotating the solid shape to fit empty space is required.
The input can be read from stdin, taken from args, can also be one or two lists/arrays, or any other valid way, but you can take in only six integers.
And the output should be one integer number: the difference.
Whole program or function are accepted.
Since this is code-golf shortest code in bytes wins!
Sample Input/Output
1) L=3  W=2  H=2  l=1  w=1  h=2
-> for item as liquid : 6 items fit completely
-> for item as solid  : 6 items fit completely
output: 0

2) L=1  W=8  H=3  l=3  w=4  h=2
-> for item as liquid : 1 item fit completely
-> for item as solid  : no items fit completely
output: 1

3) L=3  W=4  H=3  l=2  w=2  h=2
-> for item as liquid : 4 items fit completely
-> for item as solid  : 2 items fit completely
output: 2

4) L=6  W=6  H=6  l=1  w=5  h=6
-> for item as liquid : 7 items fit completely
-> for item as solid  : 7 items fit completely
output: 0

Draws
Just for illustration of how the solid items could fit:
Sample #3

Sample #4

Do we have to consider rotations of the items?

@Pietu1998. Yes. I will edit explaining that

You might want a test case such as L=6 W=6 H=6 l=1 w=5 h=6 -> 0.

@Pietu1998. I've added thanks

The solid version effectively has things like https://en.wikipedia.org/wiki/Packing_problems#Identical_rectangles_in_a_rectangle as a subproblem. So even ignoring the golfing getting this correct at all is potentially VERY hard. See also https://en.wikipedia.org/wiki/Cutting_stock_problem

Do you mean that each of the smaller solids (that, I suppose, are aproximated as cuboids) may be rotated independently to achieve optimal ocupancy of the larger solid? If so, it seems like a formidable math problem by itself.

@dnep. Yes, this is the idea

But this is not even a solved problem mathematically speaking. So how is one supposed  to judge a program that runs in any reasonable time as being correct ?

Can the solids be rotated out of alignment with the grid?

@CatsAreFluffy. Yes, but they must be inside the container

Ok, with out of alignment rotations allowed too I don't even see a way to do an exponential complexity exhaustive search anymore

Isn't this an NP-hard problem?

My instincts might be tricking me, but I have the feeling that optimal solutions would always be aligned... still it seems a pretty hard problem

Unaligned rotations are necessary. Even Packing squares in a square requires unaligned rotations.

@feersum Wow, this is wicked!

Python 2.7 - 659 548 373 355 bytes
My first golf, but still very golfable.
The rotation thing didn't make it as easy as expected though.
import numpy as n
L,W,H,l,w,h=input();bx=n.zeros((L,W,H));s=0
q=(L*W*H)//(l*w*h);o=[[l,w,h],[l,h,w],[w,l,h],[w,h,l],[h,l,w],[h,w,l]];p=n.ndindex
for i in range(q):
 for a,b,c in p(L,W,H):
  for k in o:
   d=n.copy(bx)
   try:
    for x,y,z in p(k[0],k[1],k[2]):
     if d[a+x][b+y][c+z]:raise
     d[a+x][b+y][c+z]=1
    s+=1;bx=d
   except:pass
print q-s

But still a nice little brainteaser :D
**Edit: My colleague and I pondered a little more, and we found some more optimization potential
**Saved 18 byte thanks to CatsAreFluffy
Examples:
[6,6,6,1,5,6]
0

[3,4,3,2,2,2]
2

Welcome to Programming Puzzles & Code Golf! Answers to code-golf challenges are required to be at least trivially golfed. You already used singler letter variables, which is good, but you should also remove unnecessary whitespaces between operators. Also you can write multiple statements in one line if you seperate them with a ; which saves you the newlines and the potential intendation whitespaces.

Also you only need to output one integer. There is no need to add text to it, this only increases your byte count for no reason.

Ty DenkerAffe, the edits saved some bytes :D

You can save a few bytes by defining a new range() and product() function as a one-letter function like so: r=range and p=product. You can now call range() as just r() and product() as just p()! This is a pretty good tip for built-in functions that are used many times throughout a golf.

You can also write loops or conditions in one line if they are not nested: if foo: bar() This should save you some more bytes.

I think you can remove the loop for n in range(q),  n never appear after that

the n there (now i) is the loop for the maximum possible pieces.
1 iteration wouldnt be enough :D

Something like this.

I guess you are using tabs at the moment, but StackExchange replaces them with 4 spaces, so the byte count in your title does not match the byte count in your code-block. To avoid confusing I recommend using just single spaces. If you want you can keep an ungolfed version in the post to explain your algorithm.

since I removed itertools for now, permutations doesnt work, but thanks anyways

You can use input() instead of eval(v.argv[1]) and drop the sys import.

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


text:
Is this a submatrix?
This is the 2-dimensional generalisation of this challenge.
For our purposes, one matrix (or 2D array) A is considered a submatrix of another matrix B, if A can be obtained by completely removing a number of rows and columns from B. (Note: some sources have different/more restrictive definitions.)
Here's an example:
A = [1 4      B = [1 2 3 4 5 6
     2 1]          6 5 4 3 2 1
                   2 1 2 1 2 1
                   9 1 8 2 7 6]

We can delete columns 2, 3, 5, 6 and rows 2, 4 from B to obtain A:
B = [1 2 3 4 5 6         [1 _ _ 4 _ _         [1 4  = A
     6 5 4 3 2 1   -->    _ _ _ _ _ _   -->    2 1]
     2 1 2 1 2 1          2 _ _ 1 _ _
     9 1 8 2 7 6]         _ _ _ _ _ _]

Note that A is still a submatrix of B if all rows or all columns of B are retained (or in fact if A = B).
The Challenge
You guessed it. Given two non-empty integer matrices A and B, determine if A is a submatrix of B.
You may write a program or function, taking input via STDIN (or closest alternative), command-line argument or function argument and outputting the result via STDOUT (or closest alternative), function return value or function (out) parameter.
Input may be in any convenient format. The matrices can be given as nested lists, strings using two different separators, flat lists along with the dimensions of the matrix, etc, as long as the input is not pre-processed. You may choose to take B first and A second, as long as your choice is consistent. You may assume that the elements of the matrices are positive and less then 256.
Output should be truthy if A is a submatrix of B and falsy otherwise. The specific output value does not have to be consistent.
Standard code-golf rules apply.
Test Cases
Each test case is on a separate line, A, B.
Truthy cases:
[[1]], [[1]]
[[149, 221]], [[177, 149, 44, 221]]
[[1, 1, 2], [1, 2, 2]], [[1, 1, 1, 2, 2, 2], [3, 1, 3, 2, 3, 2], [1, 1, 2, 2, 2, 2]]
[[1, 2, 3], [4, 5, 6], [7, 8, 9]], [[1, 2, 3], [4, 7, 6], [7, 8, 9], [1, 2, 3], [4, 5, 6], [7, 8, 9]]
[[228, 66], [58, 228]], [[228, 66], [58, 228]]
[[1, 2], [2, 1]], [[1, 2, 2], [2, 1, 2], [2, 2, 1]]
[[136, 196], [252, 136]], [[136, 252, 210, 196, 79, 222], [222, 79, 196, 210, 252, 136], [252, 136, 252, 136, 252, 136], [180, 136, 56, 252, 158, 222]]

Falsy cases:
[[1]], [[2]]
[[224, 15]], [[144, 15, 12, 224]]
[[41], [150]], [[20, 41, 197, 150]]
[[1, 2, 3], [4, 5, 6], [7, 8, 9]], [[1, 2, 3], [7, 8, 9], [4, 5, 6]]
[[1, 2, 2], [2, 1, 2], [2, 2, 1]], [[1, 2], [2, 1]]
[[1, 2, 2], [2, 1, 2]], [[1, 2], [2, 1], [2, 2]]
[[1, 2], [3, 4]], [[5, 3, 4, 5], [2, 5, 5, 1], [4, 5, 5, 3], [5, 1, 2, 5]]
[[158, 112], [211, 211]], [[158, 211, 189, 112, 73, 8], [8, 73, 112, 189, 211, 158], [211, 158, 211, 158, 211, 158], [21, 158, 199, 211, 212, 8]]

I suppose this is a single character in Jelly.

@Nᴮᶻ not in APL too? :P

@RikerW No, APL only has these and these single character "solutions", while Jelly keeps surprising us with new single character primitives, including most of the leftmost column here...

Pyth, 10 bytes
}CQsyMCMyE

Test suite
This is fairly straightforward. First, we consider B as a list of rows, and take all subsets using yE. Then, each of those matrices is transposed with CM, and all subsets are taken of their rows, with yM. Concatenating these sublists with s gives all possible transposed submatrices. So we transpose A with CQ, and check if it is present with }.

Dyalog APL, 53 43 bytes
(⊂A)∊⊃∘.{∧/∊2</¨⍺⍵:B[⍺;⍵]⋄⍬}/⍳¨(⍴A←⎕)/¨⍴B←⎕

B←⎕, A←⎕prompt for B and A
⍴B,  ⍴A dimensions of B and A
/¨ replicate each, e.g. 2 3/¨4 5 → (4 4) (5 5 5)
⍳¨ all indices in each of the coordinate systems with those dimensions
∘.{…}/ table of possible submatrices, where each submatrix is defined as the result of the anonymous function {…} applied between a pair of coordinates ⍺ and ⍵
∧/∊2</¨: if both ⍺ and ⍵ are (∧/∊) both (¨) increasing (2</), then...
B[⍺;⍵] return submatrix of B created from the intersections of rows ⍺ and columns ⍵
⋄⍬ else, return an empty vector (something that A is not identical to)
(⊂A)∊⊃ check if the whole of A (⊂A) is a member of ∊ any of the submatrices (⊃)

Old 53-byte solution:
{(⊂⍺)∊v∘.⌿h/¨⊂⍵⊣v h←(⍴⍺){↓⍉⍺{⍵/⍨⍺=+⌿⍵}(⍵/2)⊤⍳⍵*2}¨⍴⍵}

{…} an anonymous inline function, where ⍺ is left argument and ⍵ is right argument
⍴ shape, e.g. 2 3 for a 2-by-3 matrix
(⍴⍺){…}¨⍴⍵ for each pair of corresponding dimension-lengths, apply this anonymous function
⍳⍵*2 indices of the square of, i.e. 2 → 1 2 3 4
(⍵/2)⊤ convert to binary (number of bits is dimension-length squared)
{⍵/⍨⍺=+⌿⍵} of the binary table, select the columns (⍵/⍨) where the number of 1s (+⌿⍵) is equal to the the length of that dimension in the potential submatrix (⍺=)
↓⍉ make table into list of columns
v h← store as v(ertical masks) and h(horizontal masks)
⊣ then
h/¨⊂⍵ apply each horizontal mask to the right argument matrix
v∘.⌿ apply each vertical mask each one of the horizontally masked versions of the large matrix
(⊂⍺)∊ check if the left argument matrix is member thereof

Jelly, 12 10 bytes
Thanks @Dennis for -2 bytes
ZŒP
ÇÇ€;/i

Nearly the same algorithm as @isaacg, except we transpose the matrix before taking subsets.
ZŒP      Helper link. Input: z
Z          Transpose z
ZŒP        All subsets of columns of z.

ÇÇ€;/i   Main link. Input: B, A. B is a list of rows.
Ç          Call the helper link on B. This is the subsequences of columns of A.
 Ç€        Call the helper link on each column-subsequence.
           Now we have a list of lists of submatrices of B.
   ;/      Flatten that once. The list of submatrices of B.
     i     then get the 1-based index of A in that list.
           If A is not in the list, returns 0.

Try it here.

Longer than Pyth‽ Impostor!

@Nᴮᶻ I didn't say this was the shortest Jelly solution.

Z at the beginning is shorter than Z}. You can save a further byte by making ZŒP a helper link.

@Dennis Ok, that matches Pyth. Now golf away one more byte.

Worth noting that in modern Jelly this is just ZŒP$⁺€Ẏi.

Brachylog, 4 bytes
⊇z⊇z

Try it online!
Takes matrix B through the input variable and matrix A through the output variable, and outputs through success or failure. This is pretty much just the Pyth solution, except the input is more implicit and there's no explicit generation or membership checking for the powersets.
        B
⊇       has a sublist
 z      which transposed
  ⊇     has a sublist
   z    which transposed
        is A.

Mathematica, 40 65 bytes
!FreeQ[s[# ]&/@(s=Subsets)@#2,# ]&

Explanation: See one of the other answers -- it looks like they all did the same thing.

Haskell, 66 bytes
import Data.List
t=transpose
s=subsequences
(.((s.t=<<).s)).elem.t

Usage example: ( (.((s.t=<<).s)).elem.t ) [[149, 221]] [[177, 149, 44, 221]] -> True.
A non-pointfree version is
f a b = elem(transpose a) $ (subsequences.transpose=<<) $ subsequences b

                      subsequences b     -- make all subsequences of b, i.e. all
                                         -- all combinations of rows removed
     (subsequences.transpose=<<)         -- transpose each such sub-matrix and
                                         -- remove rows again. Concatenate into a
                                         -- single list
elem(transpose a)                        -- check if the transposition of a is in
                                         -- the list

Python + NumPy, 176 173 bytes
from itertools import*
from numpy import*
def f(A,B):
 r,c=A.shape
 R,C=B.shape
 S=combinations
 print any([all(B[ix_(i,j)]==A)for i in S(range(R),r)for j in S(range(C),c)])

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


text:
Print all the numbers! (At least, as many as possible.)
Your task is to print a number. Simple, right? It is simple, but not as simple as this. The first answer is to print the number 1, the second answer is to print the number 2, etc.
Rules

The first answer must print 1, and the nth answer must print n.
The first answer may be of any length.
Whitespace, comments, etc. are permitted.
The next answer's submission's length must within 1 unit of the previous answer's length. That is, if a submissions length is L, the next submission must be of length L + 1 or L - 1. The length is measured in characters, not bytes.
No language may be used more than once.
No person may answer earlier than eight hours after their most recent answer.
No person may answer twice in a row.
You may not use a REPL environment.

To win, you must have the most valid answers to this question. You may use a language updated after/ made later than this challenge so long as the language was not intended to answer this challenge.
Answer template
All answers must conform to this template.
# Answer N, Lang name, M characters

    program

 optional description

Leader board
A leader board will be maintained here in this section. (If anyone wants to create a leader board counting the number of submissions a person has, I will give them a 50 rep bounty on any answer to this question.)

I'm voting to close this as too broad, as, quote: "There are either too many possible answers..."

@CoolestVeto How?

How can you win?   This can go on forever.  The winner just changes constantly?

@RikerW I guess that it's a question of who can find the most languages to answer in. However, another plausible criterion is the person with the most answers after  without any new answers.

The idea is good, but it needs something to make it harder after each answer. This would have benefited from some time in the sandbox.

@LegionMammal978 I think that is a good idea.

This is far too broad in my opinion. You can basically fill your code with no-ops until the desired number of bytes is reached.

Answer 8, Carrot, 3 bytes
8^

Note the trailing space.

Answer 2, GolfScript, 1 character
2

Pushes the number 2 to the stack.

Answer 4, CJam, 3 characters
2))

Pushes 2 and increments twice.
Other solutions:
C4/
D5%
T3+

Answer 5, dc, 2 characters
5p

Pushes 5 and prints it.

Answer 6, pl, 3 characters
6⌂⌂

The last two characters are no-ops.

Answer 7, Befunge, 4 characters
43+.

Add 4 to the stack, then 3, add the top 2 stack values, then print the top value as an int.

Answer 10, PowerShell, 3 chars
+10

Even when not golfing we need to golf. :) Frustratingly, though, here the + is superfluous, but we can't go down to 2 chars since the Fission answer was 4.

Related

Answer 12, MSM, 3 characters
.21

. concatenates the two rightmost elements 2 and 1 to 12. MSM stops when there's only one element left.

Answer 14, Pylons, 3 characters.
B4+

Pushes 10 and 4 to the stack and then adds them.
Try it online

Answer 13, TI-BASIC, 2 characters
13

Pretty much.

Answer 15, 05AB1E, 4 characters
4o<?

Try it here.
Basically, it does 2^4 - 1.

I based my answer on valid answers, ignoring the PHP one.

Your language caught my attention on another challenge, so I tried it :D Thanks for creating it @AandN !

Haha, no problem :). It's always nice to see someone else use 05AB1E too :).

Note: This language is pronounced Osable, not Usable or Osabie.

...It didn't even occur to me it was a word. Welp

Answer 1, Retina, 0 characters

The empty program outputs the number of matches on the input. Since the empty program matches the input once, 1 is outputted.. Try it online!

that was fast. that reminds me i need to include an answer template

Answer 3, Vitsy, 2 bytes
3N

Pushes three, outputs three.
Try it online!
For lols, verbose mode:
push 3;
output top as number;

Damnit, was going to post a Vitsy answer. >.<

@RikerW Vitsy'd.

Answer 9, Fission, 4 characters
R'9O

Creates an atom moving right
Sets its mass to character value of 9
Outputs the ascii character of the mass and destroys the atom
Try it online

Answer 11, Pyth, 2 characters
11

Yawn...

Answer 16, Jelly, 3 characters
⁴OO

The two O's was just to fill the remaining 2 characters. Test here.

You should've waited till there's a shorter answer in the chain ;)


text:
How many sides does this polygon have?
So in 1st grade math, you learn the names of polygons. Three sides is a triangle, 4 is a square, and 5 is a pentagon. However, in 1st grade honors, you go a bit further.
Your challenge
There is a naming system for polygons above a few sides, so arbitrarily large polygons have a name.
Your task is to write a program or a function that accepts the name of a polygon as input and outputs the number of sides it has.
The names of polygons are defined as in the left column of this wikipedia article with a few exceptions.
Three sided polygons will be called a triangle instead of a trigon and 4 sided polygons will be a square instead of a tetragon (assume that all the polygons are regular). Otherwise, the names in the article will be used.
Rules

Input will be a string value.
The program should print the result to STDOUT (or it should return an integer).
Only polygons between 3 and 99 will be inputted.
Your program must satisfy all test cases.
No standard loopholes.
The program doesn't need to do anything for invalid/out of range inputs.
Scoring is in bytes. Since this is code-golf, shortest program wins.

Test cases
3   triangle
4   square
5   pentagon
10  decagon
11  hendecagon
12  dodecagon
13  triskaidecagon
20  icosagon
21  icosikaihenagon
22  icosikaidigon
34  triacontakaitetragon
35  triacontakaipentagon
36  triacontakaihexagon
47  tetracontakaiheptagon
48  tetracontakaioctagon
49  tetracontakaienneagon
64  hexacontakaitetragon
80  octacontagon
81  octacontakaihenagon
99  enneacontakaienneagon

Leaderboards
Here is a Stack Snippet to generate both a regular leaderboard and an overview of winners by language.

var QUESTION_ID=75229,OVERRIDE_USER=41505;function answersUrl(e){return"https://api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function commentUrl(e,s){return"https://api.stackexchange.com/2.2/answers/"+s.join(";")+"/comments?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+COMMENT_FILTER}function getAnswers(){jQuery.ajax({url:answersUrl(answer_page++),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){answers.push.apply(answers,e.items),answers_hash=[],answer_ids=[],e.items.forEach(function(e){e.comments=[];var s=+e.share_link.match(/\d+/);answer_ids.push(s),answers_hash[s]=e}),e.has_more||(more_answers=!1),comment_page=1,getComments()}})}function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){e.items.forEach(function(e){e.owner.user_id===OVERRIDE_USER&&answers_hash[e.post_id].comments.push(e)}),e.has_more?getComments():more_answers?getAnswers():process()}})}function getAuthorName(e){return e.owner.display_name}function process(){var e=[];answers.forEach(function(s){var r=s.body;s.comments.forEach(function(e){OVERRIDE_REG.test(e.body)&&(r="
"+e.body.replace(OVERRIDE_REG,"")+"
")});var a=r.match(SCORE_REG);a&&e.push({user:getAuthorName(s),size:+a[2],language:a[1],link:s.share_link})}),e.sort(function(e,s){var r=e.size,a=s.size;return r-a});var s={},r=1,a=null,n=1;e.forEach(function(e){e.size!=a&&(n=r),a=e.size,++r;var t=jQuery("#answer-template").html();t=t.replace("{{PLACE}}",n+".").replace("{{NAME}}",e.user).replace("{{LANGUAGE}}",e.language).replace("{{SIZE}}",e.size).replace("{{LINK}}",e.link),t=jQuery(t),jQuery("#answers").append(t);var o=e.language;/s.lang?1:e.lang<s.lang?-1:0});for(var c=0;c<t.length;++c){var i=jQuery("#language-template").html(),o=t[c];i=i.replace("{{LANGUAGE}}",o.lang).replace("{{NAME}}",o.user).replace("{{SIZE}}",o.size).replace("{{LINK}}",o.link),i=jQuery(i),jQuery("#languages").append(i)}}var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe",COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk",answers=[],answers_hash,answer_ids,answer_page=1,more_answers=!0,comment_page;getAnswers();var SCORE_REG=/<h\d>\s*([^\n,]*[^\s,]),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/,OVERRIDE_REG=/^Override\s*header:\s*/i;
body{text-align:left!important}#answer-list,#language-list{padding:10px;width:290px;float:left}table thead{font-weight:700}table td{padding:5px}
 <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">

Leaderboard

	Author	Language	Size

Winners by Language

Language	User	Score

{{PLACE}}	{{NAME}}	{{LANGUAGE}}	{{SIZE}}	Link

{{LANGUAGE}}	{{NAME}}	{{SIZE}}	Link

To make sure that your answer shows up, please start your answer with a headline, using the following Markdown template:
# Language Name, N bytes

where N is the size of your submission. If you improve your score, you can keep old scores in the headline, by striking them through. For instance:
# Ruby, <s>104</s> <s>101</s> 96 bytes

If there you want to include multiple numbers in your header (e.g. because your score is the sum of two files or you want to list interpreter flag penalties separately), make sure that the actual score is the last number in the header:
# Perl, 43 + 2 (-p flag) = 45 bytes

You can also make the language name a link which will then show up in the leaderboard snippet:
# [><>](http://esolangs.org/wiki/Fish), 121 bytes

Related

Not all tetragons are squares.

@Dennis But all regular tetragons are.

Note that the question that FryAmTheEggman points out goes in the opposite direction: This question goes from name to number of sides, while the prior one goes from number of sides to name.

Close-voters: These questions are not the same.

@DanielM. They may not be the same, but to me, simply reversing the task doesn't sufficiently differentiate it.

What was wrong with quadrilateral?

@Neil When you see "Triangle, __________, Pentagon, Hexagon", what's the first word that comes to mind?

I'm pretty sure it was quadrilateral, otherwise I wouldn't have bothered mentioning it.

@Neil Maybe, but there are already answers, so it wouldn't be fair to change it now

Now that I look at the answers, I see they look for the q anyway, so they'd probably accept quadrilateral.

You know, a lot of these answers don't accept any names not shown in the test cases (for instance, the Cinnamon Gum answer does not accept nonagon as a valid input). Is that okay?

@R.Kap Catering to the test cases is a standard loophole, so they should be able to accept them all.

@DanielM. Well then , since most of the current answers don't accept all shape names with sides from 0-99, they are invalid candidates.

@R.Kap Looking at the Wikipedia article, ennagon is the correct thing, and it wouldn't be good to change the challenge after there are answers.

Wow, never heard of an enneagon before. I had always thought a nine-sided polygon is a nonagon, but apparently that's not the only possible name for it. Well, you live and you learn.

Ruby, 405 207 bytes
207 bytes
->a{i,n=0,"#{a}";[/ontag|sa/,/(he|mo)n/,/di|do|ic/,/tri/,/tet|q/,/pe/,/hex/,/hep/,/oc/,/enn/,/^d/,/1d/,/2d/].each{|r|n.gsub!(r,i.to_s);i+=1;};n=n.gsub(/ide/,'!').gsub(/[a-z]/,'');n='1'+n[0] if /!/=~n;n.to_i}

Ungolfed 207
    sides = ->a{
          i,n=0,"#{a}";
          # Match patterns for zero, one, two, etc.
          # Each regex corresponds to a digit.
          # Special patterns for 10, 11 and 12.
          [/ontag|sa/,/(he|mo)n/,/di|do|ic/,/tri/,
             /tet|q/,/pe/,/hex/,/hep/,/oc/,/enn/,
             /^d/,/1d/,/2d/].each {|r| n.gsub!(r, i.to_s);i+=1;};
          n=n.gsub(/ide/,'!').  # Change part of the teens to exclamation
              gsub(/[a-z]/,''); # Remove remaining unmatched letters
          n='1'+n[0] if /!/=~n; # Fixup the teens
          n.to_i
      }

405 bytes:
->a{d=%w(on hen d tr te p hex hep oc e);case a when/de/ then %w(de hen do tr te p hex hep o e ).index(a[/^(he|t|d)?./]||:de)+10;when/^([mdtspoe]|he[xp]).{,7}$/ then %w(z m d t s p hex hep o e).index($1);when/^i.*[ks]a.([dep]|on|oc|tr|te|hen|hex|hep)/ then d.index($1)+20;when/^((he|t)?[^ht]).*nta(kai)?([gdpoe]|tr|te|hen|hex|hep)/ then (3+%w(tr te p hex hep o e).index($1))*10+(d.index($4)||0)else 0;end}

Ungolfed 405
def sides(a)
  d=%w(on hen d tr te p hex hep oc e);
  case a
    when /de/ then %w(de hen do tr te p hex hep o e ).index(a[/^(he|t|d)?./]||:de)+10;
    when /^([mdtspoe]|he[xp]).{,7}$/ then %w(z m d t s p hex hep o e).index($1);when/^i.*[ks]a.([dep]|on|oc|tr|te|hen|hex|hep)/ then d.index($1)+20;
    when /^((he|t)?[^ht]).*nta(kai)?([gdpoe]|tr|te|hen|hex|hep)/ then (3+%w(tr te p hex hep o e).index($1))*10+(d.index($4)||0)
    else 0;
  end
end

Maybe not the best golf submission, but it might win an obfuscated code contest!
Test
polygons = %w(
  gone
  monogon digon
  triangle square
  pentagon hexagon
  heptagon octagon
  enneagon decagon
  hendecagon dodecagon
  triskaidecagon tetrakaidecagon
  pentakaidecagon hexakaidecagon
  heptakaidecagon octakaidecagon
  enneakaidecagon icosagon
  icosikaihenagon icosikaidigon
  icosikaitrigon icosikaitetragon
  icosikaipentagon icosikaihexagon
  icosikaiheptagon icosikaioctagon
  icosikaienneagon triacontagon
  triacontakaihenagon triacontakaidigon
  triacontakaitrigon triacontakaitetragon
  triacontakaipentagon triacontakaihexagon
  triacontakaiheptagon triacontakaioctagon
  triacontakaienneagon tetracontagon
  tetracontakaihenagon tetracontakaidigon
  tetracontakaitrigon tetracontakaitetragon
  tetracontakaipentagon tetracontakaihexagon
  tetracontakaiheptagon tetracontakaioctagon
  tetracontakaienneagon pentacontagon
  pentacontakaihenagon pentacontakaidigon
  pentacontakaitrigon pentacontakaitetragon
  pentacontakaipentagon pentacontakaihexagon
  pentacontakaiheptagon pentacontakaioctagon
  pentacontakaienneagon hexacontagon
  hexacontakaihenagon hexacontakaidigon
  hexacontakaitrigon hexacontakaitetragon
  hexacontakaipentagon hexacontakaihexagon
  hexacontakaiheptagon hexacontakaioctagon
  hexacontakaienneagon heptacontagon
  heptacontakaihenagon heptacontakaidigon
  heptacontakaitrigon heptacontakaitetragon
  heptacontakaipentagon heptacontakaihexagon
  heptacontakaiheptagon heptacontakaioctagon
  heptacontakaienneagon octacontagon
  octacontakaihenagon octacontakaidigon
  octacontakaitrigon octacontakaitetragon
  octacontakaipentagon octacontakaihexagon
  octacontakaiheptagon octacontakaioctagon
  octacontakaienneagon enneacontagon
  enneacontakaihenagon enneacontakaidigon
  enneacontakaitrigon enneacontakaitetragon
  enneacontakaipentagon enneacontakaihexagon
  enneacontakaiheptagon enneacontakaioctagon
  enneacontakaienneagon
  )

sides =  ->a{i,n=0,"#{a}";[/ontag|sa/,/(he|mo)n/,/di|do|ic/,/tri/,/tet|q/,/pe/,/hex/,/hep/,/oc/,/enn/,/^d/,/1d/,/2d/].each{|r|n.gsub!(r,i.to_s);i+=1;};n=n.gsub(/ide/,'!').gsub(/[a-z]/,'');n='1'+n[0] if /!/=~n;n.to_i}

polygons.each {|p| puts "#{p} -> #{sides.call(p)}"; }

Python2 - 357 368 byte
Since the only real exceptions to the system are "square", "hendecagon" and "dodecagon", all other numbers follow the same pattern of having "kai" for second digits and "conta"/"deca" for their first digit.
import sys;s=input();e=eval;x='y(str(10*i(b)+i(a)))';y=sys.exit;a=b='0';l=['0','hen','di','tri','tet','pen','hex','hep','oct','enn'];i=l.index
if'kai'in s:
 a=[f for f in l if f in s[-8:]][0]
if'ca'in s:
 if l[1]in s:y("11")
 if'do'in s:y("12")
 b=l[1];e(x)
elif'co'in s:
 l[2]='ico';b=[f for f in l if f in s[:5]][0];e(x)
if'sq'in s:y("4")
y(str(i(s[:3])))

Explanation:
import sys;s=input();e=eval;x='y(str(10*i(b)+i(a)))';y=sys.exit;a=b='0'
l=['0','hen','di','tri','tet','pen','hex','hep','oct','enn']
# List of all defining numerals, index equals the number.
i=l.index

if'kai'in s:                       # check if the input is a two-digit number
                                   # with a second digit greater than 0
 a=[f for f in l if f in s[-8:]][0] # get the second digit, and store it.

if'ca'in s:                        # Special case for 10-19
 if l[1]in s:y("11")               # Exceptions 11 & 12
 if'do'in s:y("12")                #
 b=l[1];e(x)
elif'co'in s:                      # All other two digit numbers
 l[2]='ico'
 b=[f for f in l if f in s[:5]][0] # Get the first digit, and store it
 e(x)
if'sq'in s:y("4")                  # Exception "square"
y(str(i(s[:3])))                   # All other single digit numbers

This works for all inputs between 3-99, and prints the result to the console.
Might be more golfable, but this is as far as I can go right now.
**Edit: I just realized, this printed to STDERR, not STDOUT.
Fixed code is a little longer:
import sys;s=input();e=eval;x="10*i(b)+i(a)";y=sys.exit;a=b='0';l=['0','hen','di','tri','tet','pen','hex','hep','oct','enn'];i=l.index
if'kai'in s:a=[f for f in l if f in s[-8:]][0]
if'ca'in s:
 if l[1]in s:print"11"
 if'do'in s:print"12"
 b=l[1];print e(x);y()
elif'co'in s:l[2]='ic';b=[f for f in l if f in s[:5]][0];print e(x);y()
if'q'in s:print"4"
print(i(s[:3]))

Can you save a byte by just testing for q instead of sq?

Yup, youre right. Ty

You remove the import sys; and just use y=exit. It does the same thing.

Cinnamon Gum, 430 bytes
0000000: 6c4c ce85 0d04 4108 05d0 6e36 9e5b 379a  lL....A...n6.[7.
0000010: 5977 f7f2 6f02 8410 fdbc 11fe 75f4 f9d2  Yw..o.......u...
0000020: 4eb5 e5c1 b9df f951 5b3e 6cf5 72e5 edba  N......Q[>l.r...
0000030: 5801 74f5 8729 3469 238c 602d 29c5 502f  X.t..)4i#.`-).P/
0000040: 4b8d 3181 aa2e 3139 b6b9 bac8 e440 b5ca  K.1...19.....@..
0000050: e082 5977 8e79 2fe2 c155 5f47 ae89 f76b  ..Yw.y/..U_G...k
0000060: a21e 5ab8 8f26 eaa5 85fb 694a a02f d713  ..Z..&....iJ./..
0000070: b36b 63ee cdb1 294c e408 553d 822b 701d  .kc...)L..U=.+p.
0000080: 249e 0836 47f3 c5b0 3a5a a07e ff88 4245  $..6G...:Z.~..BE
0000090: 1b5f 8bc4 d692 2916 c2fa 6809 98fd 79b9  ._....)...h...y.
00000a0: f2ef 9e0d 32ff 9baa 8b43 3982 288a a121  ....2....C9.(..!
00000b0: 35d4 c3fc 03b3 3f4b cbd2 1d3a 43ad d77f  5.....?K...:C...
00000c0: 1ef2 9fe1 bc44 1ce7 b862 39e1 8ee7 a43a  .....D...b9....:
00000d0: a653 ceb8 4eab 633b e38c efec d7f7 0060  .S..N.c;.......`
00000e0: dc04 0be3 a143 8c57 1563 1c67 2123 3c48  .....C.W.c.g!#<H
00000f0: 19c9 6066 94bb 9cd1 0c86 c6b8 4b1a fbf5  ..`f........K...
0000100: f546 9a37 c1d2 7ce8 48f3 a54a 9ac7 59d2  .F.7..|.H..J..Y.
0000110: 0c0f 9266 7a40 9ae5 2e69 b607 a439 ee92  ...fz@...i...9..
0000120: e67e fe6a 81d6 cd59 ce7a c87f cc7a 8928  .~.j...Y.z...z.(
0000130: eb50 8dac a0db 5849 17b1 8a6c 6135 5dc0  .P....XI...la5].
0000140: 1ab2 7db5 5fff 4100 fb26 58d8 0f1d 62bf  ..}._.A..&X...b.
0000150: 5419 fb28 1bd9 a1c1 ca4e 0633 bbd4 edec  T..(.....N.3....
0000160: 6630 b447 ddd2 decf bf56 a073 7396 739e  f0.G.....V.ss.s.
0000170: bf0c 735e 22ca 3954 2327 e836 4ed2 459c  ..s^".9T#'.6N.E.
0000180: 225b 384d 1770 866c dfec d785 02e0 de04  "[8M.p.l........
0000190: 0bf7 a143 dc97 2ae3 1e65 2337 3458 b9c9  ...C..*..e#74X..
00001a0: 60e6 96ba 9ddb 0c86 eea8 5bba fb1f       `.........[...

This is a hexdump of the source code; you can reverse it using xxd -r.
Try it online.


text:
Generate E-series of preferred numbers
Resistors and other electronic components are typically manufactured with values that conform to one of the E-series of preferred numbers.  IEC 60063 defines the following E-series:

E6:
10 15 22 33 47 68
E12:
10 12 15 18 22 27 33 39 47 56 68 82
E24:
10 11 12 13 15 16 18 20 22 24 27 30 33 36 39 43 47 51 56 62 68 75 82 91
E48:
100 105 110 115 121 127 133 140 147 154 162 169 178 187 196 205 215 226 237 249 261 274 287 301 316 332 348 365 383 402 422 442 464 487 511 536 562 590 619 649 681 715 750 787 825 866 909 953
E96:
100 102 105 107 110 113 115 118 121 124 127 130 133 137 140 143 147 150 154 158 162 165 169 174 178 182 187 191 196 200 205 210 215 221 226 232 237 243 249 255 261 267 274 280 287 294 301 309 316 324 332 340 348 357 365 374 383 392 402 412 422 432 442 453 464 475 487 499 511 523 536 549 562 576 590 604 619 634 649 665 681 698 715 732 750 768 787 806 825 845 866 887 909 931 953 976
E192:
100 101 102 104 105 106 107 109 110 111 113 114 115 117 118 120 121 123 124 126 127 129 130 132 133 135 137 138 140 142 143 145 147 149 150 152 154 156 158 160 162 164 165 167 169 172 174 176 178 180 182 184 187 189 191 193 196 198 200 203 205 208 210 213 215 218 221 223 226 229 232 234 237 240 243 246 249 252 255 258 261 264 267 271 274 277 280 284 287 291 294 298 301 305 309 312 316 320 324 328 332 336 340 344 348 352 357 361 365 370 374 379 383 388 392 397 402 407 412 417 422 427 432 437 442 448 453 459 464 470 475 481 487 493 499 505 511 517 523 530 536 542 549 556 562 569 576 583 590 597 604 612 619 626 634 642 649 657 665 673 681 690 698 706 715 723 732 741 750 759 768 777 787 796 806 816 825 835 845 856 866 876 887 898 909 920 931 942 953 965 976 988

Given a single input integer from the set {6, 12, 24, 48, 96, 192}, output the corresponding E-series, in order, containing exactly the numbers as shown above for the given series.

Output may be in whatever format of list, array, etc is appropriate for your language.
Base 10 integers only.
builtins that specifically implement these series are disallowed.

Python 3, 97 bytes
lambda n:[round(10**(i/n+2-(n<25)))+((.4<i/n<.67)-(.9<i/n<.92))*(n<25)+(i==185)for i in range(n)]

The output values scaled from 1 to 10 are well-approximated by an exponential interpolation:
10**(i/n)

Multiplying by 10 for 6, 12, 24 and 100 for 48, 96, 192 then rounding to the nearest integer
round(10**(i/n+2-(n<25)))

gives the right answers for all but 16 values, which gives errors of ±1.
n   i   est val  diff
6   3   32  33  -1
6   4   46  47  -1
12  5   26  27  -1
12  6   32  33  -1
12  7   38  39  -1
12  8   46  47  -1
12  11  83  82  1
24  10  26  27  -1
24  11  29  30  -1
24  12  32  33  -1
24  13  35  36  -1
24  14  38  39  -1
24  15  42  43  -1
24  16  46  47  -1
24  22  83  82  1
192 185 919 920 -1

For n<=24, most of these errors are for inputs values in the interval 10/24<=i/n<=6/24. There's one other error for n==24 that trickles down to n==12, and one error for n==192. We fudge these errors by adding or subtracting 1 to the estimate.

Mathematica, 904 879 bytes
If[#>4!,{100,101,102,104,105,106,107,109,110,111,113,114,115,117,118,120,121,123,124,126,127,129,130,132,133,135,137,138,140,142,143,145,147,149,150,152,154,156,158,160,162,164,165,167,169,172,174,176,178,180,182,184,187,189,191,193,196,198,200,203,205,208,210,213,215,218,221,223,226,229,232,234,237,240,243,246,249,252,255,258,261,264,267,271,274,277,280,284,287,291,294,298,301,305,309,312,316,320,324,328,332,336,340,344,348,352,357,361,365,370,374,379,383,388,392,397,402,407,412,417,422,427,432,437,442,448,453,459,464,470,475,481,487,493,499,505,511,517,523,530,536,542,549,556,562,569,576,583,590,597,604,612,619,626,634,642,649,657,665,673,681,690,698,706,715,723,732,741,750,759,768,777,787,796,806,816,825,835,845,856,866,876,887,898,909,920,931,942,953,965,976,988}[[;;;;192/#]],{10,11,12,13,15,16,18,20,22,24,27,30,33,36,39,43,47,51,56,62,68,75,82,91},[[;;;;24/#]]]&

Ungolfed Massive-list-free Logic-only version:
If[#>4!,{E192}[[;;;;192/#]],{E24}[[;;;;24/#]]]&

Almost version, 60 bytes
Floor[Table[If[#>4!,100,10]Surd[10,#]^x,{x,0,#}]+.5][[;;-2]]

Accurate to within ±1

Pretty sure you can do much better than that by mathematically generating the list.  Hint: 192nd root of 10.

Not quite. :( That gives 920 when it's 919 for input 192.

So there's some sort of "One True Formatting" that must be used everywhere?(Sorry, but why the edit?)

@CatsAreFluffy h2 is generally preferred to h1, though not everyone follows that rule—justification is that h1 should be the biggest thing on a page. By the way, I think Mathemeatica wouldn't be a bad name for a new golfing language...


text:
Help develop Alphys' newest puzzle!
Alphys, the Underground's Royal Scientist, has finished a prototype for a new puzzle. However, she can't seem to find anyone willing to test it.

The rules of her puzzle are as follows:
The goal is to get to the right side, starting from the centermost tile on the left side. For puzzles with even-numbered heights, start on the lower of the two center tiles. (Examples: In a zero-indexed 4x4 array, the starting position would be [2,0] - row 2, column 0. In a zero-indexed 5x5 array the starting position would be [2,0] - row 2, column 0.)
Each colored tile has its own "sadistic" function:

Pink and green tiles (represented as "P" and "G") do nothing
Red and yellow tiles ("R", "Y") are impassable.
Orange tiles ("O") make the player smell like oranges
Purple tiles ("U") force the player to the next tile in the direction they are facing and make them smell like lemons
Blue tiles ("B") are passable as long as the player does not smell like oranges.

To clarify the flavor mechanic, a player's smell will persist indefinitely or until overridden by a different-smelling tile, i.e. if a player steps on an orange tile they will smell like oranges until they step on a purple tile.
Additionally, a yellow tile placed vertically or horizontally adjacent to a blue tile will cause the blue tile to become impassable as well.

Your task is to write a program or function that accepts a 2-dimensional character array (or 1D string  array, or some other valid format) representing the puzzle's layout as input and outputs both the original puzzle and the solved puzzle, with asterisks or some other character showing the correct path. Assume that the given puzzle is solveable.
Use this puzzle as an example:
BGYBG
PGPBG
PUBPB
OUGYB
PPOPP

Your program would output:
BGYBG
PGPBG
PUBPB
OUGYB
PPOPP

BGYBG
PGPBG
*****
OUGYB
PPOPP

Any puzzle used must be generated using this.
Standard code golf rules apply. Best answers will be the shortest for each language. Answers must contain the language, number of bytes, and three test cases. The first two can be any layout you choose, but the third must be:
RRRR
RPPR
PUOR
RPBP

Proposed test case: RRRR | RPPR | PUOR | RPBP. If I didn't make a mistake, this requires that you go over the U tile twice. Also I'm unsure about the behaviour of U when the tile after it is impassable, can you still walk onto the U or are you unable to do that?

@FryAmTheEggman If the tile after the U tile is impassable, you can't walk on the U tile in that direction.

@TimmyD Guess I didn't notice that when I first did that puzzle.

@crayzeedude I think you got Fry's test case wrong. It should be RPPR in the second row, not RPRR.

@Sherlock9 Whoops! Indeed I did, thanks.

No, the second row was the one with the problem, not the first row.

@Sherlock9 Ohh okay. Sorry, brain is kinda off today.

If it's the lowermost row, shouldn't it be [1, 0] instead of [2, 0] for a 4x4 map?

No? If the map's coordinates range from [0, 0] to [3, 3], then [2, 0] is in the second row from the bottom

C 529 bytes
#define M m[y][x]
char**m,*l,i;main(Y,X){for(;scanf("%ms",&l)>0;)(m=realloc(m,Y*8))[Y-1]=l,X=puts(m[Y++-1])-2;puts("");int s(x,y,c,d){(x<0|y<0|y/Y)?:({if(M^'R'&&M^'Y')if(M^'B'||c^2&&!((y&&m[y-1][x]=='Y')|(x&&m[y][x-1]=='Y')|(y<Y-1&&m[y+1][x]=='Y')|(x<X-1&&m[y][x+1]=='Y'))){x^X?:({M='#';return 1;});c=M^'O'?c:2;M^'U'?:({return s(x+(d<4?d-2:0),y+(d>3?d-5:0),1,d)?({M='#';1;}):0;});if(d^1&&s(x+1,y,c,3)||d^4&&s(x,y+1,c,6)||d^6&&s(x,y-1,c,4)||d^3&&s(x-1,y,c,1)){M='#';return 1;}}});return 0;}s(0,--Y/2,0,3);for(;i<Y;)puts(m[i++]);}

We approach the puzzle by stepping first to the right, provided we are not blocked, then trying up, then down and finally back to the left.  The search is recursive and once we identify a successful path, we mark the spaces in our matrix and return.
Try it Online
Ungolfed
#include <stdio.h>
#include <malloc.h>
char**m,*l,i;
main(Y,X) {
  for(Y=1;scanf("%ms",&l)>0;Y++)
      m=realloc(m,Y*8),
      m[Y-1]=l,
      X=puts(m[Y-1])-2;
  puts("");
  int step(x,y,c,d,i){
    if(x<0||y<0||y>=Y)return 0;
      if(m[y][x]=='R'||m[y][x]=='Y')return 0;
      if(m[y][x]=='B'&&(c==2||(y&&m[y-1][x]=='Y')||(x&&m[y][x-1]=='Y')
               ||(y<Y-1&&m[y+1][x]=='Y')||(x<X-1&&m[y][x+1]=='Y')))return 0;
      if(x==X){m[y][x]='#';return 1;}
      if(m[y][x]=='O')c=2;
      if(m[y][x]=='U')return step(x+(d<4?d-2:0),y+(d>3?d-5:0),1,d,i+1)?({m[y][x]='#';1;}):0;
      else if((d!=1&&step(x+1,y,c,3,i+1)) ||
    (d!=4&&step(x,y+1,c,6,i+1)) || (d!=6&&step(x,y-1,c,4,i+1)) ||
    (d!=3&&step(x-1,y,c,1,i+1))) {m[y][x]='#';return 1;}
      return 0;
  }
  step(0,--Y/2,0,3,0);
  for(;i<Y;)puts(m[i++]);
}

Example Output 1
PYYOPPPP
YRGGRYRG
PGPBYPUR
PYRBOYOG
OBPGYYPP
PRGPOYPO
YPYOUGPP
YGROBRYY
RGRYBBOG

PYY#####
YR##RYRG
###BYPUR
#YRBOYOG
#BPGYYPP
PRGPOYPO
YPYOUGPP
YGROBRYY
RGRYBBOG

Example Output 2
PBYRYPGP
OBRGOOBG
PGPGUROO
PUGORBUG
PUPUUURO
BGGUYPRG
GBOPGGRG
PUPUBUYB
GYOPRPOG

PBYRYPGP
OBRGOOBG
PGPGUROO
PUGORBUG
###UUURO
BG#UYPRG
GB####RG
PUPUB#YB
GYOPR###

Example Output 3
RRRR
RPPR
PUOR
RPBP

RRRR
R##R
###R
R###

Is this allowed?

Python3, 640 bytes
M=[(1,0),(-1,0),(0,-1),(0,1)]
E=enumerate
def f(b):
 D=eval(str(b))
 C=[(j,k)for j,r in E(b)for k,_ in E(r)]
 q=[(len(b)//2,0,b,0,{})]
 while q:
  x,y,b,s,m=q.pop(0)
  b[x][y]='#'
  if y==len(b[0])-1:return b
  for X,Y in M:
   if(K:=(x+X,y+Y))in C and K not in m.get((x,y),[])and(B:=D[x+X][y+Y])not in['R','Y']and(B!='B'or(s!=1 and[]==[1 for Q,W in M if(x+X+Q,y+Y+W)in C and'Y'==D[x+X+Q][y+Y+W]])):
     I=eval(str(b));P={**m,(x,y):m.get((x,y),[])+[K]}
     if'U'==B:
      T=2;I[x+X][y+Y]='#';Z,G=x+X+X,y+Y+Y;J,K=[K,(Z,G)][(Z,G)in C]
      if D[J][K]not in['R','Y']:q+=[(J,K,I,[T,1]['O'==D[J][K]],P)]
     else:q+=[(*K,I,[s,1]['O'==B],P)]

Try it online!

Fail $\begin{matrix}G&G&G&G&R\G&G&U&G&R\O&O&G&G&B\G&G&G&G&R\G&G&G&G&R\end{matrix}$

@l4m2 Updated...


text:
Good Old Suffix Vector
Inspired by an old manual...
The challenge
I define the ath suffix vector of b as the boolean list of length a with b trailing truthy values.
Write a program or function that, given a and b by any means, returns the ath suffix vector of b by any means.
Now this may seem trivial, but here is the catch: Your score is the byte count plus the earliest year your solution would have worked.
Rules
All standard rules apply, except that languages and language versions that were released after this challenge, may also be used.
Output using whatever representation of boolean values that your language uses, e.g. 1/0, True/False, TRUE/FALSE, "True"/"False", etc.
Output using whatever representation of lists that your language uses, e.g. 0 0 1, [False,False,True], (FALSE;FALSE;TRUE), {"False","False","True"}, etc.
You may assume that a ≥ b is always true and that they are of an appropriate data type.
Test cases
Given a = 7 and b = 3, return 0 0 0 0 1 1 1
Given a = 4 and b = 4, return [True,True,True,True]
Given a = 2 and b = 0, return (FALSE;FALSE)
Given a = 0 and b = 0, return {}
Example solution and scoring
I might want to submit the solution {⌽⍺↑⍵⍴1} using Dyalog APL. That would be a bytecount of 8. This is a dynamic function, which works from version 8.1 of Dyalog APL, released in 1998, so my total score is 2006. My submitted answer should look something like:
# Dyalog APL 8.1, 1998 + 8 = 2006
    {⌽⍺↑⍵⍴1}

Optional explanation...
Recommended: Link to documentation showing when the features you used were released.

Lowest score wins!

I'm deeply concerned about the verifiability of the answers.

@Dennis Same. For example I am fairly confident that my answer would have worked on the first Prolog interpreters but I actually can't easily check it.

@Dennis I understand you concern. However, 1) the answers will mostly be very simple, and thus could be verified by hand – not requiring an actual running system, and 2) some users have taken to linking to documentation of their claim.

I'm not so sure "verified by hand" is necessarily going to work for some answers - the past is a foreign place, and sometimes initial versions of things can lack things that feels commonplace today...

@Sp3000 Maybe, but this is all for fun anyway, and with 8 answers and 9 upvotes in 1.5h, I think this challenge is fun enough accept that someone might cheat. Maybe some extra research on the eventual winner...

@Nᴮᶻ If a release is dated on 31 December, that may be interpreted as the following year depending on locale (see drolex's comment to my answer). Can Github date be used as the official date (whatever  locale the Github server is using)? Should I add 1 to the score just in case?

SMP, 1983+94=2077:{[0]:{[0]:{},[2]:"(FALSE;FALSE)"},[3]:{[7]:"0 0 0 0 1 1 1"},[4]:{[4]:"[True,True,True,True]"}} Moral of the story: don't mix output formats.

@CatsAreFluffy What?

I'd suggest using one array format for the test cases.

@CatsAreFluffy The idea was to show that any of those formats are valid. I think the cases are few and simple enough that ease of copy-paste'ing isn't an issue.

There's an answer that displays the string {} for the empty list. However, in TI-BASIC, {} doesn't represent anything; it throws an error when evaluated. Is this valid?

Hang on, working on an answer using http://history-computer.com/Babbage/NextDifferentialEngines/Scheutz.html. :-)

Things to avoid when writing challenges.

This is an old challenge, but it isn't explicitly stated: is a lower score better?

@cairdcoinheringaahing Yes.

APL\360, 1968 + 3 bytes = 1971
⎕⍵⎕

A builtin from the tutorial @NBZ linked to. I don't know why @NBZ said it would score 1970, because APL\360 wasn't implemented until 1968, and earlier APLs like APL\1130 didn't have the suffix vector function (see page 208 of here).

Forth,  1970 + 38 = 2008
:s tuck +do 0 . loop 0 +do -1 . loop ;

usage:  7 3 s prints "0 0 0 0 -1 -1 -1"

Now we're talking!

Why -1? filler+

That's one of the more interesting 'truthy' values I've seen lately.

http://stackoverflow.com/q/23832703/10396

Is there a good reason this is named sv and not s, or something else one byte?

Good question;  changed.

What's +do do?

Pops i, then j from the stack and does the equivalent of for (;i<j;i++)  on the following instructions up to  loop

SAS, 1966 + 45 = 2011
data;a=;b=;do i=1to a;c=a-i<b;put c@;end;run;

Time for SAS to shine!
SAS wasn't first published until 1972, but this data step only uses very basic features that I'm fairly confident would have been available even in the earliest pre-release versions from 1966 onwards, so I believe it would have worked then. Input goes after a= and b=, and output is printed to the log.
I would be amazed if anyone still had an IBM System/360 with the right version of SAS to actually verify this!

The machine is available....

Now, if only I had the cash for a mainframe SAS licence...

APL, 1968+5=1973
Down to 5 chars:
⌽⎕≥⍳⎕

Older version:
⌽⎕↑⎕⍴1

Well, you actually already gave the answer, i just removed the dynamic function definition and checked that this one worked in 1968. For reference here is the manual:
http://www.softwarepreservation.org/projects/apl/Books/APL360ReferenceManual

Kids, this is called a winner. Please write that down in your notes.

@CatsAreFluffy Not yet. @Moris Zucca: Finally, but you can actually golf half of those bytes away. Can you figure out how? Also, here is a much more modern and readable version of the manual.

Mouse-1979, 1979 + 19 = 1998
??&TUCK (0.a)0(1-.)

Translation of: Forth.
The spec is really cryptic to me but I think this does the right thing.

Broken link....

@CatsAreFluffy Fixed; I typed it from memory.

Interesting. But I don't think the &Tuck was available until the 2002 version. And the loops appear to be infinite.

TI-Basic, 1990 + 21 = 2011
The first TI calculator that this program works on is the TI-81, introduced in 1990.
Prompt A,B:"{}
seq(I>A-B,I,1,A

Edit: noticed that I must support an empty list... increased code by 4 bytes
Test Cases
A=?7
B=?3
{0 0 0 0 1 1 1}

A=?4
B=?4
{1 1 1 1}

A=?2
B=?0
{0 0}

A=?0
B=?0
{}   * throws an error but still returns successfully

Could you add commentary on which parts of the source are single bytes in TI-Basic? I think that includes Prompt and seq( but I'm not sure about the rest

We don't consider returning through Ans an acceptable output method, unless it's printed.

@Sparr Sure, Prompt and seq( are one byte tokens and the other characters are one byte each.

@lirtosiast Ans is the default way to return a value in the TI-83 series Basic. Additionally, when a program is run, the last line is printed automatically. So you have the best of both worlds.

When the list is empty, though, Ans contains the string {}. Even if we say that's a representation of an empty list, it's never printed. As for Ans being the default return variable, you should ask on meta.

@lirtosiast True, for the last case it is not explicitly displayed, but it is still returned. There is no other way to return a value except for Ans.

In general we do not allow programs or functions to output values by storing them into variables, but we do allow them to print. If you think an exception should be made for Ans, please post on meta.

Too bad this has to support empty list...then it would be winning (by 1 yearbyte)

@CatsAreFluffy I know...

@CatsAreFluffy NOt at all, I have a solution in mind that scores 1970.

Is it the Analytical Engine? Somebody should do that...

Mathematica 1.0, 1988+22 bytes=2010
Array[#>m&/.m->#-#2,#]&

I'm not sure if this works, just went through the documentation on 10.3 and looked for things that said Introduced in 1988 (1.0)

Just about the current winner. If only the SMP code could get shorter...

On another note though, some docs: pure functions, /. and ->, Array

68k TI-Basic, 1995 + 25 = 2020
The first TI calculator that this program works on is the TI-92, introduced in 1995.
define f(a,b)=seq(x>a-b,x,1,a)

Unlike the TI-83 series, 68k TI-Basic supports the empty list.

How is the size counted? Tokenization is very different on the 68k series.

Prompt and seq are both two bytes plus a one byte flag for multiple arguments. (21 bytes)

Note that this is neither a program nor a function in the context of the 68k calculators: Prompt is invalid in a function, and a program can't return a value. So this has to be entered on the home screen. On the other hand, define f(a,b)=seq(x>a-b,x,1,a) does define a valid function that can be given a and b as arguments. (Verified on my TI-92 from 1995-09-13)

I own several TI calculators (the only z80-version being the 81), but usually use a TI-92 Plus. After running this define and calling f(2,1) or similar to tokenize it, the size reported by the OS is 25 bytes.

Python 1.0, 1994 + 26 = 2020
Saved 2 bytes thanks to DSM.
Lambda was introduced with the first major release, 1.0
lambda a,b:[0]*(a-b)+[1]*b

Confirmed lambda introduced in 1.0, list (sequence) repetition in 0.9.2. The oldest version I could test this on (apart from 0.9.1) was 1.5.2, and it works fine there.

@Sp3000 Oh wow, that's awesome. I've been trying to find some change logs to confirm that the sequence repetition was in the language that early.

MATL, 2015 + 1 + 4 = 2020
:P<~

This works since release 6.0.0 of the language (it uses implicit input, which was introduced in that release), dated December 31, 2015.
I've added 1 to the score in accordance with @drolex comment on possibly different locales.
Try it online!
Explanation
:    % take first input implicitly. Generate inclusive range from 1 to that
P    % flip that array
<~   % take second input implicitly. True for elements of flipped array that
     % exceed second number. Display implicitly

One day later, and...

Objection! We'll need to have the locales for the github server and the release submitter. If one is in Tonga and the other in Hawaii, this count might need to be incremented.

@drolex The OP should define what he means by "year", exactly. Meantime, I'm adding 1 to my score

@DonMuesli I didn't mean it, just showing the potential limitations of this type of scoring

@drolex Oh, I thought you were serious. I've asked the OP, anyway. Github date should probably count as official

J, 1990 + 8 = 1998
|.a{.b#1

Argh. Was researching this answer and someone got to APL before I could hope to understand the language. Here's my J solution instead.

Prolog, 1972 + 57 = 2029
a(0,_,[]).
a(A,B,[H|L]):-Z is A-1,a(Z,B,L),(Z<B,H=1;H=0).

Usage: a(7,3,L). will unify L with [0,0,0,0,1,1,1].
I'm really not quite sure when is was implemented in the language, and I doubt you can actually find the exact date. It's a pretty basic built-in though so I assume it was already existing when the language first appeared in 1972.
Not that it really matters though, I'm far from winning with this answer.

This may not be the winner, but it clearly illustrates the advantage of exploring - ehm - mature languages...

SMP, 1983+28 bytes=2011
Map[S[$1>x,x->$1-$2],Ar[$1]]

I think I got this right...
S:2.10, page 48
Ar:7.1, page 102
Map:7.2, page 106
$1:7.1, page 104
And if you're familiar with Mathematica, no, Ar doesn't work like that. More like Range+Select.

(#>x&/.x->#)/@Range[#+#2]& in Mathematica

I mean (#>x&/.x->#-#2)/@Range[#]&

Vim, 1991 + 21 = 2012
"adwj<c-x>"bdw@ai0<esc>v@bhr1

Input looks like this:
7
3

And output looks like this:
0000111

Explanation:
"adw                            'Delete a word into register a
    j<c-x>                      'Go down a line, and decrement the next number to occur
          "bdw                  'Delete a word into register b
              @ai0<esc>         'Insert a '0' "a" times
                       v        'Enter visual mode
                        @bh     'Move "b" characters left
                           r1   'Replace the whole selection with the character '1'

Too bad vi doesn't support registers, because it was released in 1976!

Explanation please?

B, 1971 + 54 = 2025
s(l,t){while(t<l--)printn(0,8);while(t--)printn(1,8);}

See "The User's Reference to B" for the manual for this typeless C precursor.

Pyth, 2015 + 9 4 = 2024 2019
Thanks to @FryAmTheEggman for his help!
gRQE

Try it here!
Explanation

gRQE    # Q = amount of trailing truthy values
        # E = length of the vector
 R E    # map over range(E)
g Q     # d >= Q

><>, 2009 + 14 + 3 for -v = 2026
b and a should be provided directly on the stack with -v, in reverse order.
The output isn't space separated as in the examples, but that does not seem to go against any stated rule. It uses 0 and 1 to represent false and true, as used by the language.
:?!;{:0(n1-}1-

It doesn't work with the current version since ? now pops its test value from the stack.
I'm not confident every feature was implemented from day 1, -v for example could have been provided later as a commodity. I'll try to make sure my answer is correct this weekend.

? didn't pop (a long time ago) as stated in the quine challenge

Thanks, that's great news, I'll save 1 byte :) I'll edit that now, but I'll have to check the resources linked on esolang.org, some date back to at least 2011.

Quine challenge and esolang

Thanks for your help, I wouldn't have thought to check the wiki's revisions ! I'm currently at work and won't probably be able to check everything yet, but I'll make sure to do it this evening or tomorrow.

Score=2026 now.

Woops, thanks. Although I think I'll have to put 2010, that's the oldest documented version on the wiki.

05AB1E, 2016 + 9 = 2025
This can definitely be golfed further, but here's a start :p. Code:
-0s×1¹×«S

Try it online! The input is given as b, a.
Also 9 bytes: 0×1I×0ñRS.

Yeah, it can definitely be golfed... (did ° exist back in 2016 btw?)

PowerShell v1, 2006 + 28 = 2034
param($a,$b),0*($a-$b)+,1*$b

Uses the comma operator to construct the array(s), which has been in PowerShell since the beginning.

Javascript ES6, 2015 + 46 = 2061
Returns array of 0 and 1
(a,b)=>Array(a-b).fill(0).concat(Array(b).fill(1))

Javascript ES6, 2015 + 50 = 2065
Returns a string of 0 and 1 chars
(a,b)=>Array(a-b+1).join(0)+Array(b+1).join(1)

Javascript, 1995 + 61 = 2056
Returns a string of 0 and 1 chars
function(a,b){return Array(a-b+1).join(0)+Array(b+1).join(1)}

Mathcad, 1998 + 42 = 2040
"bytes" are interpreted as number of distinct keyboard characters (eg, 'for' operator (including one programming line) is a single character ctl-shft-#, or a click on the Programming toolbar)).
The above byte count assumes that the a and b definitions don't count towards the total; add 4 bytes for definitions if this assumption is invalid.
The function version shown below adds 5 bytes for the definition and a further 3 bytes for each use (assuming the a and b values are directly typed in).
As my Mathcad solution should clearly be playing off the red tees and not the competition ones, I've added a table of solutions.  Note that as Mathcad has no empty array, I've used an empty string ("") instead; I've used 0 to indicate where I haven't calculated the b>a pairs.

Very interesting!

k (kona), 1993 + 15 = 2008
((a-b)#0b),b#1b

Creates list of b True values, and concatenates it to a list of (a-b) False values.

PHP, 1995 + 56 bytes = 2051
function s($a,$b){while($i++<$a)$v[]=$i>$a-$b;return$v;}

Exploded view
function s($a,$b) {
  while ($i++ < $a) $v[] = $i > $a - $b;
  return $v;
}

Uh..there's custom scoring. It's first year language woks in+byte count.

Whoops, right you are!  Fixing...

Making the probably-incorrect assumption of this working in PHP 1.  Will verify version soon.

R, 20 bytes + 1993 = 2013
function(a,b)1:a>a-b

Try it online!
Possibly this might work in S, which would drop the score to 2008, but I haven't been able to verify it.

SmileBASIC 3, 2014 + 25 = 2039
The first publicly available version of SmileBASIC 3 launched in Japan with the SmileBASIC app for Nintendo 3DS in November 2014.
Prints a string where 0 is false and 1 is true (as they are in the language itself.)
INPUT A,B?"0"*(A-B)+"1"*B


text:
Old Spanish alphabetical order
Before 1994, Spanish dictionaries used alphabetical order with a peculiarity: digraphs ll and ch were considered as if they were single letters. ch immediately followed c , and ll immediately followed l. Adding the letter ñ, which follows n in Spanish, the order was then:
a, b, c, ch, d, e, f, g, h, i, j, k, l, ll, m, n, ñ, o, p, q, r, s, t, u, v, w, x, y, z

Since 1994 ll and ch are considered as groups of two letters (l,l and c,h respectively), and thus alphabetical order is the same as in English, with the exception of the letter ñ.
The old order was definitely more interesting.
The challenge
Input a list of zero or more words and output the list sorted according to the old Spanish alphabetical order. Sorting is between words (not between letters within a word). That is, words are atomic, and the output will contain the same words in a possibly different order.
To simplify, we will not consider letter ñ, or accented vowels á, é, í, ó, ú, or uppercase letters. Each word will be a sequence of one or more characters taken from the inclusive range from ASCII 97 (a) through ASCII 122 (z).
If there are more than two l letters in a row, they should be grouped left to right. That is, lll is ll and then l (not l and then ll).
Input format can be: words separated by spaces, by newlines, or any convenient character. Words may be surrounded  by quotation marks or not, at your choice. A list or array of words is also acceptable. Any reasonable format is valid; just state it in your answer.
In a similar way, output will be any reasonable format (not necessarily the same as the input).
Code golf, shortest wins.
Test cases
In the following examples words are separated by spaces. First line is input, second is output:
llama coche luego cocina caldo callar calma
caldo calma callar cocina coche luego llama

cuchara cuchillo cubiertos cuco cueva
cubiertos cuco cuchara cuchillo cueva

"Words" can be single letters too:
b c a ch ll m l n
a b c ch l ll m n

or unlikely combinations (remember the rule that l's are grouped left to right):
lll llc llz llll lllz
llc lll lllz llll llz

An empty input should give an empty output:

Of course, this order can be applied to other languages as well:
chiaro diventare cucchiaio
cucchiaio chiaro diventare

all alternative almond at ally a amber
a almond alternative all ally amber at

It's too late to correct the question now, because it has an answer, but actually rr was a single letter too. I believe it lost its status as a single letter later than ll and ch, so the explanation in Wikipedia is not so much wrong as partial.

"tweo"? filler+

@CatsAreFluffy Thanks! corrected

@PeterTaylor Was rr really considered a single letter? I had never heard that http://www.rae.es/consultas/exclusion-de-ch-y-ll-del-abecedario

It was a single letter in the first Spanish dictionary I owned.

@PeterTaylor The official academy (RAE) didn't consider rr a single letter; at least not since 1803. But it's true that apparently it was considered a single letter in the Americas

The Hungarian language has even more such peculiarities, and it didn't abandon them. cs, dz, dzs, gy, ly, ny, sz, tyand zs are all considered single letters.

@vsz hmm, with dzs it sounds like it would make for an even more interesting challenge because a single letter replacement wouldn't be sufficient.

@vsz: Hungarian also has ccs for <cs><cs>, which makes things more interesting: https://sourceware.org/bugzilla/show_bug.cgi?id=13547

Looks like Hungarian deserves a separate, much more difficult challenge :-)

@ninjalj : indeed, and technically also for ddz, ddzs, ggy, lly, nny, ssz, tty, and zzs, although a few of them are very rarely used.

I was not completely right, as the double digraphs (like ccs = cs + cs) have a different rule. And there are other exceptions besides digraphs. And there are a lot of accented vowels. I'll post a new challenge soon. :)

The Welsh alphabet has loads of them, and is probably interesting since they're not in (English) alphabetical order, or include all latin characters:
a, b, c, ch, d, dd, e, f, ff, g, ng, h, i, j, l, ll, m, n, o, p, ph, r, rh, s, t, th, u, w, y

@DonMuesli: rr was definitely considered a single letter by my teachers and textbooks in Argentina in the 70s.

@DonMuesli : Done: http://codegolf.stackexchange.com/questions/75370/hungarian-alphabetical-order

related

Pyth, 14 13 bytes
Update: saw this got accepted and noticed a trivial 1 byte golf. Whoops.
:D"ll|ch|."1Q

Try it online. Test suite.
For each word, find all non-overlapping matches for the regex ll|ch|.. This splits the word into the "letters". Then, just sort the words by the splitted lists.

Great approach! (Now that I finally understand it) :-)

That code is absolutely fascinating :D

Vyxal a, 15 bytes
µ‛ch‛c~V‛ll‛l~V

Takes input as words separated by newlines, outputs a list.
Try it Online!
µ‛ch‛c~V‛ll‛l~V    # Full program
µ                  # Sort (implicit) input by key:
       V           # Replace...
 ‛ch               # `ch`...
    ‛c~            # with `c~`
              V    # Replace...
        ‛ll        # `ll`...
           ‛l~     # with `l~`

PowerShell, 46 44 51 50 bytes
$args|sort @{e={$_-replace'(?=ch|ll)(.).','$1Α'}}

The Α character is the Greek letter alpha which in comes after all Latin letters in PowerShell's default sort order (at least on my machine, I'm not sure if it's different in other locales). It's counted as 2 bytes in UTF8 encoding.
Example usage, assuming this string is saved in a file named es-sort.ps1:
> es-sort.ps1 'lzego' 'luego' 'llama'

luego
lzego
llama

Mathematica, 81 bytes
StringReplace[Sort@StringReplace[#,"ch"->"cZ","ll"->"lZ"],"cZ"->"ch","lZ"->"ll"]&

Same approach as TimmyD's answer.

Jelly, 16 15 12 bytes
eƬ“ch“ll”µƝÞ

Try it online!
Previous 12-byter sorted leading digraphs incorrectly, since the index took precedence over the actual character data.
           Þ    Sort the input by:
         µƝ     for each pair of adjacent characters as a list,
 Ƭ              apply while unique (collecting all results):
e               is it an element of
  “ch“ll”       ['ch', 'll']?

eƬ2ƤÞ“ch“ll” also works for 12 bytes, doing precisely the same thing.

05AB1E, 15 bytes
Σ„ch„c~:„ll„l~:

I/O as a list of strings.
Very straight-forward approach, but I'm unable to find anything shorter (thus far).
Try it online or verify all test cases.
Explanation:
Σ         # Sort the (implicit) input-list of strings by:
 „ch„c~:  #  Replace all "ch" with "c~"
 „ll„l~:  #  Replace all "ll" with "l~"
          #  (and then sort it by default lexicographical order)
          # (after which the sorted list is output implicitly)

Python 2, 128 116 bytes
lambda p:map(''.join,sorted([{'!':'ll','?':'ch'}.get(c,c)for c in w.replace('ll','!').replace('ch','?')]for w in p))

I still feel like there's definitely room for improvement here.

Javascript, 95 bytes
s=>s.map(a=>a.replace(/ll|ch/g,m=>m[0]+'~')).sort().map(a=>a.replace(/.~/g,m=>m>'d'?'ll':'ch'))

77

Perl, 40 bytes
Includes +1 for -p
Run with the list of words on STDIN:
perl -p spanisort.pl <<< "llama coche luego cocina caldo callar calma"

spanisort.pl
s/ll|ch|./\u$&/g;$_="\L@{[sort split]}"

Ruby, 42 bytes
->a{a.sort_by{_1.gsub(/ll|ch/){$&[0]+?|}}}

Attempt This Online!


text:
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

What's the required output precision? I'm not sure I understand Your code must contain value that gives theoretically arbitrary precision when made arbitrary large/small. Do you mean like a loop maximum value than when increased without bound gives increased precision? Can that value be hard-coded?

@DonMuesli This means the precision depends on a parameter, say N, which you may give any value you like, but for any given precision, you can make N small or large enough to achieve that precision. The word theoretically is there because you must not worry about the limited precision of the machine or language.

To further clarify N: is it sufficient that for any bound eps and input x there exists an N which calculates zeta(x) to within eps; or must there exist an N which depends only on eps and guarantees that for any x (or perhaps for any x more than a given function of eps from the pole) it achieves the bound; or may N depend on x, but answers should explain how to calculate N given x and eps? (My analytical number theory isn't up to much, but I suspect that options 2 and 3 are going to be beyond all but one or two regular posters).

@PeterTaylor N large enough: For any x and for any eps there must exist a P such that for all N>P the output is closer than eps to the exact value. Is this clear? Do I need to clarify it for the case with N small enough?

No, that's clear enough.

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)

z(2,0) gives an incorrect value, should be pi^2/6.

Python 3, 303 297 298 bytes
This answer is based on R.T.'s Python answer with several modifications:

First, Binomial(n, k) is defined as p = p * (n-k) / (k+1) which changes Binomial(n,k) to Binomial(n,k+1) with every pass of the for loop.
Second, (-1)**k * Binomial(n,k) became p = p * (k-n) / (k+1) which flips the sign at every step of the for loop.
Third, the while loop has been changed to immediately check if a*a + b*b < E.
Fourth, the bitwise not operator ~ is used in several places where they would aid in golfing, using identities such as -n-1 == ~n, n+1 == -~n, and n-1 == ~-n. This only works for ints, however, and not floats.

Several other small modifications were made for better golfing, such as putting the for loop on one line and the call to print on one line with the code before it.
Golfing suggestions welcome. Try it online!
Edit: -6 bytes from a number of small changes.
Edit: +1 byte from fixing an error with float handling, with thanks to mostlyWright for pointing out the error.
import math as N
def z(r,i,E=1e-40):
 R=I=n=0;a=b=1
 while a*a+b*b>E:
  a=b=0;p=1;m=2**~n
  for k in range(1,n+2):M=p/k**r;p*=(k-1-n)/k;t=-i*N.log(k);a+=M*N.cos(t);b+=M*N.sin(t)
  a*=m;b*=m;R+=a;I+=b;n+=1
 A=2**(1-r;t=-i*N.log(2);x=1-A*N.cos(t);y=A*N.sin(t);d=x*x+y*y;return(R*x-I*y)/d,(R*y+I*x)/d

doesnt work for r (float)

Axiom, 413 315 292 bytes
p(n,a,b)==(x:=log(n^b);y:=n^a;[y*cos(x),y*sin(x)]);z(a,b)==(r:=[0.,0.];e:=10^-digits();t:=p(2,1-a,-b);y:=(1-t.1)^2+t.2^2;y=0=>[];m:=(1-t.1)/y;q:=t.2/y;n:=0;repeat(w:=2^(-n-1);abs(w)<e=>break;r:=r+w*reduce(+,[(-1)^k*binomial(n,k)*p(k+1,-a,-b) for k in 0..n]);n:=n+1);[r.1*m-q*r.2,m*r.2+r.1*q])

This would implement too the equation 21 from http://mathworld.wolfram.com/RiemannZetaFunction.html
The above should be the one iterpreted Axiom function z(a,b) here 16x slower than this below function Zeta(a,b)[that should be the one compiled] all ungolfed and commented
[1 second for Zeta() against 16 seconds for z() for one value of 20 digits afther the float point]. For the digit question, one would choose the precision by calling digits(); function, for example digits(10);z(1,1) should print 10 digits after the point, but digits(50);z(1,1) should print 50 digits after the point.
-- elevImm(n,a,b)=n^(a+i*b)=r+i*v=[r,v]
elevImm(n:INT,a:Float,b:Float):Vector Float==(x:=log(n^b);y:=n^a;[y*cos(x),y*sin(x)]::Vector Float);

--                      +oo               n
--                      ---              ---
--             1        \       1        \            n
--zeta(s)= ---------- * /     ------  *  /    (-1)^k(   )(k+1)^(-s)
--          1-2^(1-s)   ---n  2^(n+1)    ---k         k
--                       0                0

Zeta(a:Float,b:Float):List Float==
  r:Vector Float:=[0.,0.]; e:=10^-digits()

  -- 1/(1-2^(1-s))=1/(1-x-i*y)=(1-x+iy)/((1-x)^2+y^2)=(1-x)/((1-x)^2+y^2)+i*y/((1-x)^2+y^2)

  t:=elevImm(2,1-a,-b);
  y:=(1-t.1)^2+t.2^2;
  y=0=>[]
  m:=(1-t.1)/y;
  q:=t.2/y
  n:=0
  repeat
     w:=2^(-n-1)
     abs(w)<e=>break  --- this always terminate because n increase
     r:=r+w*reduce(+,[(-1)^k*binomial(n,k)*elevImm(k+1,-a,-b) for k in 0..n])
     n:=n+1
  -- (m+iq)(r1+ir2)=(m*r1-q*r2)+i(m*r2+q*r1)
  [r.1*m-q*r.2,m*r.2+r.1*q]

this is one test for the z(a,b) function above:

(10) -> z(2,0)
   (10)  [1.6449340668 482264365,0.0]
                                              Type: List Expression Float
(11) -> z(1,1)
   (11)  [0.5821580597 520036482,- 0.9268485643 3080707654]
                                              Type: List Expression Float
(12) -> z(-1,0)
   (12)  [- 0.0833333333 3333333333 3,0.0]
                                              Type: List Expression Float
(13) -> z(1,0)
   (13)  []