A prime test that's LITERALLY prime Write a program that will test the primality of a specified number, and give the output as a Boolean value (True is prime). Your prime test can (but doesn't have to) be valid for the number 1.

Here's the catch: your program itself has to sum to a prime number. Convert every character (including spaces) to its Unicode/ASCII value (table). Then, add all those numbers together to get the sum of your program.

For example, take this not-so-great program I wrote in Python 3.3:

q=None
y=int(input())
for x in range(2,int(y**0.5)+1):
    if y%x==0:
        q=False
if not q:
    q=True
print(q)

If you convert all the characters to their corresponding Unicode/ASCII value, you get:

113 61 78 111 110 101 10 121 61 105 110 116 40 105 110 112 117 116 40 41 41 10 102 111 114 32 120 32 105 110 32 114 97 110 103 101 40 50 44 105 110 116 40 121 42 42 48 46 53 41 43 49 41 58 10 32 32 32 32 105 102 32 121 37 120 61 61 48 58 10 32 32 32 32 32 32 32 32 113 61 70 97 108 115 101 10 105 102 32 110 111 116 32 113 58 10 32 32 32 32 113 61 84 114 117 101 10 112 114 105 110 116 40 113 41

You can then find the sum of those numbers manually or with your own program. This specific program sums to 8293, which is a prime number.

Of course, this is Code Golf, so the smaller you can make your program, the better. As pointed out by other users, this program is not very golfy.

A few rules:

Valid inputs include STDIN and prompts (no functions, it's just a way to  add free extra code). Spaces are permitted, but only if they are crucial to the functionality of your program. Output must be an output, not just stored in a variable or returned (use print, STDOUT, etc.)

Flags can be used and should be counted literally, not expanded. Comments are not allowed. As for non-ASCII characters, they should be assigned to the value in their respective encoding.

Make sure to list your program's size and the sum of the program. I will test to make sure programs are valid.

Good luck!

Here is a snippet to count the sum of your program and check if it is prime:

function isPrime(number) { var start = 2; while (start <= Math.sqrt(number)) { if (number % start++ < 1) return false; } return number > 1; } var inp = document.getElementById('number'); var text = document.getElementById('input'); var out = document.getElementById('output'); function onInpChange() { var msg; var val = +inp.value; if (isNaN(val)) { msg = inp.value.toSource().slice(12, -2) + ' is not a valid number.'; } else if (isPrime(val)) { msg = val + ' is a prime number!'; } else { msg = val + ' is not a prime number.'; } out.innerText = msg; } function onTextChange() { var val = text.value; var total = new Array(val.length).fill().map(function(_, i) { return val.charCodeAt(i); }).reduce(function(a, b) { return a + b; }, 0); inp.value = '' + total; onInpChange(); } text.onkeydown = text.onkeyup = onTextChange; inp.onkeydown = inp.onkeyup = onInpChange;
body { background: #fffddb; } textarea, input, div { border: 5px solid white; -webkit-box-shadow: inset 0 0 8px  rgba(0,0,0,0.1), 0 0 16px rgba(0,0,0,0.1); -moz-box-shadow:  inset 0 0 8px  rgba(0,0,0,0.1), 0 0 16px rgba(0,0,0,0.1); box-shadow:  inset 0 0 8px  rgba(0,0,0,0.1), 0 0 16px rgba(0,0,0,0.1);  padding: 15px; background: rgba(255,255,255,0.5); margin: 0 0 10px 0; font-family: 'Roboto Mono', monospace; font-size: 0.9em; width: 75%; }</style><meta charset="utf-8">

hello, world!, 13 bytes, 1193
hello, world!


Prolific Perfect Pangram Programs Pertaining to Printable ASCII Updates: Time limit removed. You must be able to describe output - see new rule.
A pangram is a sentence that uses every letter in the alphabet at least once, such as:

The quick brown fox jumps over the lazy dog.

A perfect pangram uses every letter exactly once.
Consider writing a program that is a perfect pangram, using the 95 printable ASCII characters (hex codes 20 to 7E) as the alphabet:
 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~

Such a program must contain exactly 95 characters, with each printable ASCII character occurring exactly once, but in any order. (Thus there are 95! = 1.03×10148 possibilities.)
Your task is to write this program such that the number of printable ASCII characters printed to stdout is as high as possible (i.e. prolific).
Your score is the number of printable ASCII characters your program outputs (the total amount, not the distinct amount: AABC scores 4 whereas ABC scores 3). The highest score wins.
Details

The output may contain any characters (including duplicates) but only instances of the 95 printable ASCII characters count towards your score.

You can use this JSFiddle to count the number of printable ASCII characters in any string.

If your language does not have stdout use the most appropriate alternative.
Your program...

must have finite runtime (the time limit has been removed)
must have finite output
may contain comments
must compile and run without (uncaught) errors
must not prompt for or require input
must be time invariant and deterministic
must not use external libraries
must not require a network connection
must not make use of external files

(you may use the program file itself as long as changing the file name does not alter the program's behavior)

If this task is impossible is some language that's just too bad.
You must give your exact output or precisely describe it if it is too large to fit in a post. You do not actually have to run your program. As long as it would run in a finite amount of time on a computer with an unbounded amount of memory it is valid.

Example
This simplistic Python 2 program is a possible solution:
print 9876543210#!"$%&'()*+,-./:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghjklmoqsuvwxyz{|}~

It outputs 9876543210 which contains 10 printable ASCII characters, thus scoring 10.

Perl, 70*18446744073709551615*10^987654320

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

Output:

!"#%&'+,-./:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ\]^_`bcdfghijklmnoprtuvwz|

repeated 18446744073709551615*10^987654320 times.

$[ is by default 0, so ~$[ is equivalent to 18446744073709551615.

As a side note, I ran out of memory trying to create the number 10^987654320.

Old Answer (7703703696):

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

Output is:

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

repeated 98765432 times.

Note: Run all samples with perl -Mbignum -E


Conway's Game of Points! Rest in peace, John Horton Conway
There are a ton of different Game of Life interpreters out there! A ton!
Currently for you, getting an interpreter is just a dozen types and a couple of clicks away.
But wait, do you notice a common thing in the interpreters? Every interpreter is graphical, i.e there are only images and no ASCII text!
The Problem
Fun fact: I was in the middle of creating a 2DF interpreter in my favourite practical programming language while writing this question. 2DF has a command that performs a step of Game of Life on its memory field. I needed to implement that command in my code. I have not done it yet, so this question is technically an actual question rather than a challenge.
I have a list of some points or coordinates on a Cartesian plane. Each point has an X and a Y value. This is your input! Input can be formated in anyway (you can use any type of formatting, so specify your format in your answers).
Example input format:
[[0, 0], [1, 0], [2, 0], [2, 1], [1, 2]]

This is a representation of a period of Glider (The Hacker Logo). Draw the points on a grid, and you will see a shape that resembles this:

What I want for output is the same list, but modified! These are the modification steps.

A new point is added if it has exactly three existing neighbours.
An existing point is removed if it has more than three or less than two existing neighbours.

What is a neighbour?
A neighbour of a point X is defined as a point adjacent to X either horizontally, vertically, or diagonaly. The neighbours of point \$(2, 3)\$ are:

\$(1, 3)\$
\$(1, 2)\$
\$(2, 2)\$
\$(3, 2)\$
\$(3, 3)\$
\$(3, 4)\$
\$(2, 4)\$
\$(1, 4)\$

In this case, the output should be similar to this:
[[1, 0], [2, 0], [2, 1], [0, 1], [1, -1]]

Task
Write a program or implement a function that takes a list of points, and prints or returns a list of points that displays the modified list according to the above modification rules (The order of the output list does not matter).
Oh, and be sure to make the code as short as possible! (code-golf)
P.S It would be great if you included an explanation of your program in your answer!
Some Example Test Cases
Example STDIN                                  Example STDOUT
[[0, 0]]                           =>          []
[[0, 0], [0, 1]]                   =>          []
[[0, 0], [0, 1], [1, 0]]           =>          [[0, 0], [0, 1], [1, 0], [1, 1]]
[[0, 0], [0, 1], [1, 0], [1, 1]]   =>          [[0, 0], [0, 1], [1, 0], [1, 1]]
[[0, 0], [0, 1], [0, -1]]          =>          [[0, 0], [1, 0], [-1, 0]]
[[1, 0], [1, 1], [1, 2]]           =>          [[2, 1], [1, 1], [0, 1]]

Good Luck! :)

APL (Dyalog Extended), 34 32 bytes (SBCS)

Anonymous tacit prefix function. Requires ⎕IO←0 (zero-based indexing).
⌊/{⍺-1-⍸⌂life 0,∘⌽∘⍉⍣4⍸⍣¯1∧⍵-⍺}⊢

Try it online!
⌊/{…}⊢ call the following anonymous lambda with the smallest existing x and y coordinates as left argument (⍺) and the full list as right argument (⍵):
 ⍵-⍺ subtract smallest point from all points (scales so every number is non-negative)
 ∧ sort ascending
 ⍸⍣¯1 generate a Boolean matrix with 1s in those positions (lit. inverse of "ɩndices of 1s")
 0…⍣4 repeat four times with zero as left argument:
  …∘⍉ transpose, then
   …∘⌽ mirror, then (this constitutes a 90° clockwise turn)
    …, concatenate zeros to the left edge
 ⌂life compute the next Game of Life generation
 ⍸ ɩndices of 1s
 1- subtract those from 1
 ⍺- subtract those from the offset of the lowest x and y coordinates


Prime Factoral Roots Inspired by digital roots, the prime factoral root of a number is the number that emerges when you take the prime factors of a number, add them together, and repeat the process on the resulting number, continuing until you end up with a prime number (which has itself as its only prime factor, and is thus its own prime factoral root).  The prime factoral root of 4 is 4, as 2*2=2+2, and this is the only non-prime prime factoral root of an integer greater than 1 (which is another special case, as it has no prime factors).  The OEIS sequence formed by prime factoral roots is A029908.

For example, the prime factoral root of 24 is:

24=2*2*2*3

2+2+2+3=9=3*3

3+3=6=2*3

2+3=5, and the only prime factor of 5 is 5.  Therefore, the prime factoral root of 24 is 5.

Your Task:

Write a program or function that finds the prime factoral root of an input integer.

Input:

An integer, input through any reasonable method, between 2 and the largest integer your language will support (inclusive).  Specifically choosing a language that has an unreasonably low maximum integer size is not allowed (and also violates this standard loophole)

Output:

An integer, the prime factoral root of the input.

Test Cases:

4   -> 4
24  -> 5
11  -> 11
250 -> 17

Scoring:

This is code-golf, lowest score in bytes wins!

05AB1E, 3 bytes

FÒO

Try it online!

Explanations:

FÒO
F    Loops <input> times + 1
 Ò   List of prime factors w/ duplicates
  O  Total sum of the list
     -- implicit output


Sharing (characters) is Caring! Overview
Consider the following task:

Given a positive integer n > 0, output its integer square root. The integer square root of a number n is the largest value of x where x2 ≤ n, usually expressed with the formula floor(sqrt(n)).
Examples: 25 -> 5, 24 -> 4, 40 -> 6, 1 -> 1.

This task is easy enough on its own. However, in this challenge, your task is to solve this in as many languages as possible using a set of only 25 characters.
Example
First, you need to pick a set (no duplicates) of 25 bytes. It may look something like this (note the leading space):
 ()*-.05:=>Mabdhilmnqrst|

Your challenge is then to, using only characters in this set, construct a solution to the problem in as many text based (sorry, Piet) languages as possible. You can use characters as many times as necessary, but you must not use characters outside the set.
The solutions can be either full programs or functions, but not snippets. For example, using this set of characters, I could do:
M -> (int) Math.sqrt(M)    // Java (lambda expression)
M => Math.sqrt(M)|0        // Javascript (unnamed function)
lambda M: int(M**.5)       // Python (lambda function)

As I've used 3 languages, this would give me a score of 3.
Please also include the set of bytes you are using in your answer.
Rules

This is a rosetta-stone challenge - your score is the number of languages your submission includes. The highest score wins. Standard loopholes apply.
For this challenge, a 'language' counts as a distinctly different programming language - multiple versions of the same language (Python 2, Python 3, etc) are banned.
Programs only need to work for inputs within the language's standard integer range.
Programs with the exact same source code (polyglots) are not allowed.
To be more specific, it is a set of bytes, not characters - so you can use the 05AB1E £ and the Jelly ɱ as the same character (because they have the same codepoint).

Please don't feel as though you have to beat all other solutions - if you have an interesting answer, post it!

20 languages

Using  ()-#*.05;=>^Vefikloqrst (24 characters) so far:

let f l=floor(l**0.5);;       OCaml
let f l=floor(l**0.5)         F#
f(l)=floor(l^.5)              Julia
f(o)=floor(o^.5)              PARI/GP
s^+>5 0>5 0*.5l               Pyth
(* **.5).floor                Perl 6
floor.(**0.5)                 Haskell
flr.(tt ^.5)                  Wonder
l=>l**.5^0                    JavaScript
l->l**.5^0                    Cheddar
.5^5*5f                       Pyke
(isqrt)                       Maple
ri.5#i                        CJam
isqrt                         Common Lisp
0.5^k                         MATL
*.5^0                         Jelly
*.^0                          M
t0^                           05AB1E
q f                           Japt
r#                            Pushy
V-                            gs2


ASCII-Art Venn Diagram Given two lists that contain no duplicate elements a and b, find the crossover  between the two lists and output an ASCII-Art Venn Diagram. The Venn Diagram will use a squarified version of the traditional circles for simplicity.

Example

Given:

a = [1, 11, 'Fox', 'Bear', 333, 'Bee']
b = ['1', 333, 'Bee', 'SchwiftyFive', 4]

Output (Order is 100% arbitrary, as long as the Venn Diagram is correct):

+-----+----+-------------+
|11   |333 |SchwiftyFive |
|Fox  |Bee |4            |
|Bear |1   |             |
+-----+----+-------------+

The program may either consider '1' == 1 or '1' != 1, up to your implementation. You may also choose to just handle everything as strings, and only accept string input.

Given:

a=[]
b=[1,2,3]

Output (Notice how the two empty parts still have the right-pad space):

+-+-+--+
| | |1 |
| | |2 |
| | |3 |
+-+-+--+

Given:

a=[1]
b=[1]

Output:

+-+--+-+
| |1 | |
+-+--+-+

Rules

Elements of the Venn Diagram are left-aligned and padded to the max length entry plus 1.
The ordering of the elements within sub-sections of the Venn-Diagram are arbitrary.
Corners of the Venn Diagram (where | meets -) must be represented by a +.
You are garuanteed that a.join(b).length() > 0, if both are empty, you may do whatever.

You may even print a picture of Abe Lincoln, don't care.

This is code-golf, ascii-art and set-theory.

Bonus

Charcoal renders boxes like this naturally, but the whole set theory part... Don't know how well it does that. +100 bounty for the shortest charcoal submission before I am able to add a bounty to the question (2 days from being asked).

Husk, 72 58 bytes
mṙ1₁Fz+m(₁TT' Ṡ:→S:öR'-→▲mL)TTømėF`-FnF-
Ṡz:(`:'+:'+R'|-2L

Try it online!
Husk does not support arrays of multiple types, so the arguments must be string arrays.
I am not sure whether I want to explain this monstrosity.
Due to it's sheer size, it takes about 28 secs(due to type inference) for the first test case mentioned. Without some of the type inference issues, this could be a lot shorter.
-14 bytes with a lot of adjustments(I got better at Husk).


The Attack of the Knights Objective

You have two knights on a standard chessboard labelled 1-8 and A-H, one knight is located at 1C and the other at 2G. You have to write a program in the language of your choosing that accepts a set of coordinates from stdin, like 2C, and then calculates which of the two knights you have to move in order to capture the enemy pawn at the provided coordinates with the least amount of moves assuming it is standing still. The program must also output which are these moves that the knight has to make.

Example Usage

# echo 1C|./faster
Move Knight: 1C
Moves:

Also

# echo 3B|./faster
Move Knight: 1C
Moves: 1C -> 3B

One more

# echo 5A|./faster
Move Knight: 1C
Moves: 1C -> 3B
Moves: 3B -> 5A

Output shall be exactly as shown.

Useful Resources

Knight's Tour

Bonuses

You get -50 Bytes if your program is expandable and works with N knights.

Mathematica  1183 483 bytes (or 190) bytes
Approach 1
240-50 (bonus) = 190 bytes
The knight's tour can be represented as a graph.  So the issue becomes simply to find the shortest path from each knight to the pawn.  Mathematica offers both KnightTourGraph and FindShortestPath as built-in functions.
w@p_:=Characters@p/.{r_,s_}:>(ToCharacterCode[s][[1]]-65)*8+ToExpression@r
z@v_:=ToString@(v~Mod~8/.{0->8})<>FromCharacterCode[Quotient[v-1,8]+65]
p_~h~k_:=Row[SortBy[(z/@FindShortestPath[8~KnightTourGraph~8,#,w@p])&/@w/@k,Length][[1]],"->"]

Examples
h["5A",{"1C","2G"}]

1C -> 3B -> 5A

h["8G",{"1C","2G"}]

2G -> 3E -> 5D -> 7E -> 8G

Approach 2
(533-50 (bonus)= 483  bytes)
Here the knight's tour graph is constructed without using KnightTourGraph.
s@v_:=
Sort[{v,#}]/.{{a_, b_}:>UndirectedEdge[a,b]}&/@(
If[If[#4==1,Greater,Less][Mod[v-1,8]+1,#1]&&If[#5==1,Greater,Less][Quotient[v-1,8]+1,#2],v+#3,Nothing]&@@@{{1,2,-17,1,1},{8,2,-15,0,1},{2,1,-10,1,1},{7,1,-6,0,1},{2,8,6,1,0},{7,8,10,0,0},{1,7,15,1,0},{8,7,17,0,0}})
w@p_:=Characters[p]/.{r_,q_}:>(ToCharacterCode[q][[1]]-65)*8+ToExpression@r
z@v_:=ToString@(Mod[v,8]/.{0 -> 8})<>FromCharacterCode[Quotient[v-1,8]+65]
p_~f~k_:=Row[SortBy[(z/@FindShortestPath[Graph[Range@64,Union@Flatten[s/@Range@64]],#,w@p])&/@w/@k,Length][[1]],"->"]

Explanation
Below are two views of the chessboard.
On the left, each chessboard position corresponds to vertex bearing an integer name.   On the right, the positions have been labelled according to the convention suggested by the OP.
In both figures, White sits on the right, Black sits on the left.

Legal moves of a knight are paths along a knight tour graph.
The function, s, generates all 512 moves (as if each square allowed for 8 knight moves), eliminates inverses, and then weeds out the moves that would land off the board.  There are 168 edges on the graph.
edges consists of a list of elements of the form, UndirectedEdge[a,b]. For instance, the edge, UndirectedEdge[1,11]corresponds to the idea that a knight at vertex 1, that is, at "A1" in standard notation, may jump to vertex 11, or "B3", and vice-versa.
toVertex takes a position (see right board) and returns a vertex (see left board).  For instance toVertex["3H"] returns 59.
toChessPosition does the opposing conversion, namely from a vertex to a chess position.
vertexNames is a list of replacements: {1->"1A",2->"2A"...64->"8H"}.
This is only needed for the right chessboard figure shown above.
numberedKnightsTouris the graph displayed above on the left.
chessKnightsTouris the graph displayed above on the right.
The graphs are constructed using the above-defined vertices and edges.
findShortestPath receives the position of the pawn and a list of positions of the knights and finds the shortest path along the graph from a knight to the pawn.
    s@v_:=
Sort[{v,#}]/.{{a_, b_}:>UndirectedEdge[a,b]}&/@(
If[If[#4==1,Greater,Less][Mod[v-1,8]+1,#1]&&If[#5==1,Greater,Less]
edges=Union@Flatten[s/@Range@64];
toVertex[p_]:=Characters[p]/.{rank_,file_}:> (ToCharacterCode[file][[1]]-65)*8+ToExpression[rank]
toChessPosition[v_]:=ToString@(Mod[v,8]/.{0->8})<>FromCharacterCode[Quotient[v-1,8]+65]
vertexNames=Thread[Range@64->(toChessPosition[#]&/@Range[64])];
numberedKnightsTour=Graph[Range@64,edges,VertexLabels->"Name",GraphLayout->"SpringEmbedding"];
vertexNames=Thread[Range[64]->(toChessPosition[#]&/@Range[64])];
chessKnightsTour=Graph[Range@64,edges,ImageSize->Large,VertexLabels-> vertexNames,GraphLayout->"SpringEmbedding"];
GraphicsGrid[{{numberedKnightsTour,chessKnightsTour}},PlotLabel->"For each board below, \nWhite sits at Right, Black at Left\nNumbers refers to rank, letters refer to file",ImageSize->Large]
    findShortestPath[pawn_,knights_]:=Row[SortBy[(toChessPosition/@FindShortestPath[chessKnightsTour,#,toVertex@pawn])&/@toVertex/@knights,Length][[1]],"->"]


Find maximal matching in divisibility relation You are given a set of positive integers. You must arrange them into pairs such that:

Each pair contains 2 numbers, one of which is a multiple of another. For example, 8 is a multiple of 4, and 9 is a multiple of 9.
If the same number occurs many times in the initial set, it can be used that many times in the pairs; a number can even be paired with another occurence of the same number
The maximum possible number of pairs is obtained.

Output must be the number of pairs. Shortest code wins.

Sample data

2,3,4,8,9,18 -> 3

7,14,28,42,56 -> 2

7,1,9,9,4,9,9,1,3,9,8,5 -> 6

8,88,888,8888,88888,888888 -> 3

2,6,7,17,16,35,15,9,83,7 -> 2

Haskell, 109 107 76 70 bytes

Thanks to nimi for saving 33 bytes and teaching me some more Haskell. :)
Thanks to xnor for saving another 6 bytes.

import Data.List
f l=maximum$0:[1+f t|a:b:t<-permutations l,a`mod`b<1]

Yay, my first Haskell golf. It works the same as all the answers so far (well, not quite: it only counts the length of the longest prefix of valid pairs in each permutation, but that's equivalent and is actually what my original CJam code did).

For extra golfitude it's also extra inefficient by recursively generating all permutations of the suffix each time the first two elements of a permutation are a valid pair.


Find an unknown very large number Let's suppose there is a finite unknown number n (n can be very large, does not necessarily fit 64-bits; think of BigInteger in Java or long in Python) and a function cmp(x) that returns true if x <= n.

Write a program to determine n in minimum number of calls to cmp.

Double our guess until we exceed n, then do binary search.  This is a reasonable approach until n could be very large, at which point you probably want to do more than doubling at each step.

b=1;
while (cmp(b)) b *= 2;
a = b/2;
while (a < b-1) {  // invariant: a <= n < b
  m = (a+b)/2;
  if (cmp(m)) {
    a = m;
  } else {
    b = m;
  }
}
return a;


Build a Nonographic Magnitude Optimizer™ A nonogram is a Japanese puzzle game in which the goal is to draw a black-and-white picture according to a list of contiguous regions, like so:

Define the nonographic magnitude of a row or column to be the number of contiguous black regions in that row or column. For example, the top row has a nonographic magnitude of 1, because there is one region of 2 squares in that row. The 8th row has a nonographic magnitude of 3 because it has 2, 2, 1.

An empty row or column has a nonographic magnitude of 0.

Your task is to write a program that takes a solution grid for a nonogram, and produces a solution grid with as few filled-in squares as possible where every row and column has the same nonographic magnutide as the given solution grid.

For example, a nonogram grid with all the squares filled in has a nonographic magnitude of 1 on every row or column:

The same nonographic magnitude could be achieved just by having a diagonal stripe through the grid, reducing the number of filled-in squares dramatically:

Your program will receive an input consisting of 50,000 lines from this file (1.32 MB tar.gz text file; 2.15 MB unzipped), each representing a single 16×16 nonogram solution grid with randomly (80% black) filled-in squares, and output another 50,000 lines, each containing the optimized solution grid for the corresponding input grid.

Each grid is represented as a base64 string with 43 characters (encoding squares from left to right, then top to bottom), and your program will need to return its output in the same format. For example, the first grid in the file is E/lu/+7/f/3rp//f799xn/9//2mv//nvj/bt/yc9/40=, and renders as:

The grid starts with E which maps to 000100, so the first six cells in the top row are all white except the fourth one. The next character is / which maps to 111111, so the next 6 cells are all black — and so on.

Your program must actually return a solution grid with the correct nonographic magnitudes for each of the 50,000 test cases. It is allowed to return the same grid as the input if nothing better was found.

The program to return the fewest total filled-in squares (in any language) is the winner, with shorter code being the tiebreaker.

Current scoreboard:

3,637,260 — Sleafar, Java
7,270,894 — flawr, Matlab
10,239,288 — Joe Z., Bash

Python 2 & PuLP — 2,644,688 squares (optimally minimized); 10,753,553 squares (optimally maximized)

Minimally golfed to 1152 bytes

from pulp import*
x=0
f=open("c","r")
g=open("s","w")
for k,m in enumerate(f):
 if k%2:
    b=map(int,m.split())
    p=LpProblem("Nn",LpMinimize)
    q=map(str,range(18))
    ir=q[1:18]
    e=LpVariable.dicts("c",(q,q),0,1,LpInteger)
    rs=LpVariable.dicts("rs",(ir,ir),0,1,LpInteger)
    cs=LpVariable.dicts("cs",(ir,ir),0,1,LpInteger)
    p+=sum(e[r][c] for r in q for c in q),""
    for i in q:p+=e["0"][i]==0,"";p+=e[i]["0"]==0,"";p+=e["17"][i]==0,"";p+=e[i]["17"]==0,""
    for o in range(289):i=o/17+1;j=o%17+1;si=str(i);sj=str(j);l=e[si][str(j-1)];ls=rs[si][sj];p+=e[si][sj]<=l+ls,"";p+=e[si][sj]>=l-ls,"";p+=e[si][sj]>=ls-l,"";p+=e[si][sj]<=2-ls-l,"";l=e[str(i-1)][sj];ls=cs[si][sj];p+=e[si][sj]<=l+ls,"";p+=e[si][sj]>=l-ls,"";p+=e[si][sj]>=ls-l,"";p+=e[si][sj]<=2-ls-l,""
    for r,z in enumerate(a):p+=lpSum([rs[str(r+1)][c] for c in ir])==2*z,""
    for c,z in enumerate(b):p+=lpSum([cs[r][str(c+1)] for r in ir])==2*z,""
    p.solve()
    for r in ir:
     for c in ir:g.write(str(int(e[r][c].value()))+" ")
     g.write('\n')
    g.write('%d:%d\n\n'%(-~k/2,value(p.objective)))
    x+=value(p.objective)
 else:a=map(int,m.split())
print x

(NB: the heavily indented lines start with tabs, not spaces.)

Example output: https://drive.google.com/file/d/0B-0NVE9E8UJiX3IyQkJZVk82Vkk/view?usp=sharing

It turns out that problems like are readily convertible to Integer Linear Programs, and I needed a basic problem to learn how to use PuLP—a python interface for a variety of LP solvers—for a project of my own. It also turns out that PuLP is extremely easy to use, and the ungolfed LP builder worked perfectly the first time I tried it.

The two nice things about employing a branch-and-bound IP solver to do the hard work of solving this for me (other than not having to implement a branch and bound solver) are that

Purpose-built solvers are really fast. This program solves all 50000 problems in about 17 hours on my relatively low-end home PC. Each instance took from 1-1.5 seconds to solve.
They produce guaranteed optimal solutions (or tell you that they failed to do so). Thus, I can be confident that no one will beat my score in squares (although someone might tie it and beat me on the golfing part).

How to use this program

First, you'll need to install PuLP. pip install pulp should do the trick if you have pip installed.

Then, you'll need to put the following in a file called "c": https://drive.google.com/file/d/0B-0NVE9E8UJiNFdmYlk1aV9aYzQ/view?usp=sharing

Then, run this program in any late Python 2 build from the same directory. In less than a day, you'll have a file called "s" which contains 50,000 solved nonogram grids (in readable format), each with the total number of filled squares listed below it.

If you'd like to maximize the number of filled squares instead, change the LpMinimize on line 8 to LpMaximize instead. You will get output very much like this: https://drive.google.com/file/d/0B-0NVE9E8UJiYjJ2bzlvZ0RXcUU/view?usp=sharing

Input format

This program uses a modified input format, since Joe Z. said that we would be allowed to re-encode the input format if we like in a comment on the OP. Click the link above to see what it looks like. It consists of 10000 lines, each containing 16 numbers. The even numbered lines are the magnitudes for the rows of a given instance, while the odd numbered lines are the magnitudes for the columns of the same instance as the line above them. This file was generated by the following program:

from bitqueue import *

with open("nonograms_b64.txt","r") as f:
    with open("nonogram_clues.txt","w") as g:
        for line in f:
            q = BitQueue(line.decode('base64'))
            nonogram = []
            for i in range(256):
                if not i%16: row = []
                row.append(q.nextBit())
                if not -~i%16: nonogram.append(row)
            s=""
            for row in nonogram:
                blocks=0                         #magnitude counter
                for i in range(16):
                    if row[i]==1 and (i==0 or row[i-1]==0): blocks+=1
                s+=str(blocks)+" "
            print >>g, s
            nonogram = map(list, zip(*nonogram)) #transpose the array to make columns rows
            s=""
            for row in nonogram:
                blocks=0
                for i in range(16):
                    if row[i]==1 and (i==0 or row[i-1]==0): blocks+=1
                s+=str(blocks)+" "
            print >>g, s

(This re-encoding program also gave me an extra opportunity to test my custom BitQueue class I created for the same project mentioned above. It is simply a queue to which data can be pushed as sequences of bits OR bytes, and from which data can be popped either a bit or a byte at a time. In this instance, it worked perfectly.)

I re-encoded the input for the specific reason that to build an ILP, the extra information about the grids that were used to generate the magnitudes is perfectly useless. The magnitudes are the only constraints, and so the magnitudes are all I needed access to.

Ungolfed ILP builder

from pulp import *
total = 0
with open("nonogram_clues.txt","r") as f:
    with open("solutions.txt","w") as g:
        for k,line in enumerate(f):
            if k%2:
                colclues=map(int,line.split())
                prob = LpProblem("Nonogram",LpMinimize)
                seq = map(str,range(18))
                rows = seq
                cols = seq
                irows = seq[1:18]
                icols = seq[1:18]
                cells = LpVariable.dicts("cell",(rows,cols),0,1,LpInteger)
                rowseps = LpVariable.dicts("rowsep",(irows,icols),0,1,LpInteger)
                colseps = LpVariable.dicts("colsep",(irows,icols),0,1,LpInteger)
                prob += sum(cells[r][c] for r in rows for c in cols),""
                for i in rows:
                    prob += cells["0"][i] == 0,""
                    prob += cells[i]["0"] == 0,""
                    prob += cells["17"][i] == 0,""
                    prob += cells[i]["17"] == 0,""
                for i in range(1,18):
                    for j in range(1,18):
                        si = str(i); sj = str(j)
                        l = cells[si][str(j-1)]; ls = rowseps[si][sj]
                        prob += cells[si][sj] <= l + ls,""
                        prob += cells[si][sj] >= l - ls,""
                        prob += cells[si][sj] >= ls - l,""
                        prob += cells[si][sj] <= 2 - ls - l,""
                        l = cells[str(i-1)][sj]; ls = colseps[si][sj]
                        prob += cells[si][sj] <= l + ls,""
                        prob += cells[si][sj] >= l - ls,""
                        prob += cells[si][sj] >= ls - l,""
                        prob += cells[si][sj] <= 2 - ls - l,""
                for r,clue in enumerate(rowclues):
                    prob += lpSum([rowseps[str(r+1)][c] for c in icols]) == 2 * clue,""
                for c,clue in enumerate(colclues):
                    prob += lpSum([colseps[r][str(c+1)] for r in irows]) == 2 * clue,""
                prob.solve()
                print "Status for problem %d: "%(-~k/2),LpStatus[prob.status]
                for r in rows[1:18]:
                    for c in cols[1:18]:
                        g.write(str(int(cells[r][c].value()))+" ")
                    g.write('\n')
                g.write('Filled squares for %d: %d\n\n'%(-~k/2,value(prob.objective)))
                total += value(prob.objective)
            else:
                rowclues=map(int,line.split())
print "Total number of filled squares: %d"%total

This is the program that actually produced the "example output" linked above. Hence the extra long strings at the end of each grid, which I truncated when golfing it. (The golfed version should produce identical output, minus the words "Filled squares for ")

How it Works

cells = LpVariable.dicts("cell",(rows,cols),0,1,LpInteger)
rowseps = LpVariable.dicts("rowsep",(irows,icols),0,1,LpInteger)
colseps = LpVariable.dicts("colsep",(irows,icols),0,1,LpInteger)

I use an 18x18 grid, with the center 16x16 part being the actual puzzle solution. cells is this grid. The first line creates 324 binary variables: "cell_0_0", "cell_0_1", and so on. I also create grids of the "spaces" between and around the cells in the solution part of the grid. rowseps points to the 289 variables which symbolize the spaces that separate cells horizontally, while colseps similarly points to variables that mark the spaces that separate cells vertically. Here's a unicode diagram:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
  - - - - - - - - - - - - - - - -
0|□|□|□|□|□|□|□|□|□|□|□|□|□|□|□|□|0
  - - - - - - - - - - - - - - - -
0|□|□|□|□|□|□|□|□|□|□|□|□|□|□|□|□|0
  - - - - - - - - - - - - - - - -
0|□|□|□|□|□|□|□|□|□|□|□|□|□|□|□|□|0
  - - - - - - - - - - - - - - - -
0|□|□|□|□|□|□|□|□|□|□|□|□|□|□|□|□|0
  - - - - - - - - - - - - - - - -
0|□|□|□|□|□|□|□|□|□|□|□|□|□|□|□|□|0
  - - - - - - - - - - - - - - - -
0|□|□|□|□|□|□|□|□|□|□|□|□|□|□|□|□|0
  - - - - - - - - - - - - - - - -
0|□|□|□|□|□|□|□|□|□|□|□|□|□|□|□|□|0
  - - - - - - - - - - - - - - - -
0|□|□|□|□|□|□|□|□|□|□|□|□|□|□|□|□|0
  - - - - - - - - - - - - - - - -
0|□|□|□|□|□|□|□|□|□|□|□|□|□|□|□|□|0
  - - - - - - - - - - - - - - - -
0|□|□|□|□|□|□|□|□|□|□|□|□|□|□|□|□|0
  - - - - - - - - - - - - - - - -
0|□|□|□|□|□|□|□|□|□|□|□|□|□|□|□|□|0
  - - - - - - - - - - - - - - - -
0|□|□|□|□|□|□|□|□|□|□|□|□|□|□|□|□|0
  - - - - - - - - - - - - - - - -
0|□|□|□|□|□|□|□|□|□|□|□|□|□|□|□|□|0
  - - - - - - - - - - - - - - - -
0|□|□|□|□|□|□|□|□|□|□|□|□|□|□|□|□|0
  - - - - - - - - - - - - - - - -
0|□|□|□|□|□|□|□|□|□|□|□|□|□|□|□|□|0
  - - - - - - - - - - - - - - - -
0|□|□|□|□|□|□|□|□|□|□|□|□|□|□|□|□|0
  - - - - - - - - - - - - - - - -
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

The 0s and □s are the binary values tracked by the cell variables, the |s are the binary values tracked by the rowsep variables, and the -s are the binary values tracked by the colsep variables.

prob += sum(cells[r][c] for r in rows for c in cols),""

This is the objective function. Just the sum of all the cell variables. Since these are binary variables, this is just exactly the number of filled squares in the solution.

for i in rows:
    prob += cells["0"][i] == 0,""
    prob += cells[i]["0"] == 0,""
    prob += cells["17"][i] == 0,""
    prob += cells[i]["17"] == 0,""

This just sets the cells around the outer edge of the grid to zero (which is why I represented them as zeroes above). This is the most expedient way to track how many "blocks" of cells are filled, since it ensures that every change from unfilled to filled (moving across a column or row) is matched by a corresponding change from filled to unfilled (and vice versa), even if the first or last cell in the row is filled. This is the sole reason for using an 18x18 grid in the first place. It's not the only way to count blocks, but I think it is the simplest.

for i in range(1,18):
    for j in range(1,18):
        si = str(i); sj = str(j)
        l = cells[si][str(j-1)]; ls = rowseps[si][sj]
        prob += cells[si][sj] <= l + ls,""
        prob += cells[si][sj] >= l - ls,""
        prob += cells[si][sj] >= ls - l,""
        prob += cells[si][sj] <= 2 - ls - l,""
        l = cells[str(i-1)][sj]; ls = colseps[si][sj]
        prob += cells[si][sj] <= l + ls,""
        prob += cells[si][sj] >= l - ls,""
        prob += cells[si][sj] >= ls - l,""
        prob += cells[si][sj] <= 2 - ls - l,""

This is the real meat of the logic of the ILP. Basically it requires that each cell (other than those in the first row and column) be the logical xor of the cell and separator directly to its left in its row and directly above it in its column. I got the constraints that simulate an xor within a {0,1} integer program from this wonderful answer: https://cs.stackexchange.com/a/12118/44289

To explain a bit more: this xor constraint makes it so that the separators can be 1 if and only if they lie between cells which are 0 and 1 (marking a change from unfilled to filled or vice versa). Thus, there will be exactly twice as many 1-valued separators in a row or column as the number of blocks in that row or column. In other words, the sum of the separators on a given row or column is exactly twice the magnitude of that row/column. Hence the following constraints:

for r,clue in enumerate(rowclues):
    prob += lpSum([rowseps[str(r+1)][c] for c in icols]) == 2 * clue,""
for c,clue in enumerate(colclues):
    prob += lpSum([colseps[r][str(c+1)] for r in irows]) == 2 * clue,""

And that's pretty much it. The rest just asks the default solver to solve the ILP, then formats the resulting solution as it writes it to the file.


Determine win in Tictactoe Let's play some code golf!
Given a tic-tac-toe board state (Example:)
|x|x|o|
|x|o|x|
|o|o|x|

Determine whether a game is a win a lose or cat. Your code should output any of these options given a state. The above game should output lose
Just to be clear: a win is defined as any 3 xs in a row (diagonal, horizontal, vertical). a lose is 3 os in a row, while a cat game in none in a row.
To make things interesting, you get to determine your input structure for the state- which you must then explain. For instance xxoxoxoox is a valid state as seen above where each of the characters is read from left to right, top to bottom. [['x','x','o'],['x','o','x'],['o','o','x']] is the game in multidimensional array read in a similar way. While 0x1a9 which is hex for 110101001 might work as a suitable compression where 1 can be manipulated for xs and 0 can be manipulated for o.
But those are just some ideas, I'm sure you might have many of your own.
Ground rules:

Your program must be able to accept any viable state.
The form of input must be able to represent any state.
The input cannot be redundant, meaning each cell must only appear in one location.
"The win state must be determined from the board"
Assume a complete board
Win before lose for instance in the case 'xxxoooxxx'

Lowest character count wins

Ruby 2.0, 85 characters

Here's a simple bitmask-based solution in Ruby:

d=gets.hex
$><<[292,146,73,448,56,7,273,84].map{|m|d&m<1?:lose:d&m<m ?:cat: :win}.max

The board is represented as a hex number, made up of nine bits corresponding to the nine squares.  1 is an X, 0 is an O.  This is just like the 0x1a9 example in the question, though the 0x is optional!

There's probably a better way to do the bitmasks then just hardcoding a big list.  I'll happily take suggestions.

See it running on Ideone here.


Reverse Bayer Filter of an image Almost all digital camera sensors are organized in a grid of photosensors. Each photo sensor is sensitive for one of the primary colors: red, green and blue. The way those photo sensors are organized is called the Bayer filter, after its inventor, Bryce Bayer of Eastman Kodak. After an image is taken, four photo sensors compose the RGB value of one pixel in the resulting image. Your task is to reverse that process and colorize the resulting pixels according to their filter color. For the sake of simplicity, we will ignore gamma correction.

For example: the "normal" forward Bayer filter steps are:

a lightray with a Pantone Beeswax color hits the sensor;
the BGGR (Blue - Green / Green - Red) filter decomposes this into four rays.
The four rays hit the sensor, which reads: 81 - 168 / 168 - 235 (sensor values range from 0 - 255);
The Bayer filter translates this to one RGB pixel with color (235, 168, 81).

The reverse Bayer filter steps are:

RGB pixel with color (235, 168, 81) is split into four pixels with RGB values: (0,0,81) - (0,168,0) / (0,168,0) - (235,0,0).

Challenge

You should write the shortest possible function or program that does the following:

Take a filename as in input and output the DeBayered image.
The output may be written to a file or displayed on the screen.
The output must be twice the width and twice the height of the original image.
Each pixel of the input image must be mapped according to the BGGR (Blue - Green / Green - Red) Bayer filter pattern as explained graphically in the following picture:

We'll assume that both green photosensors receive the same signal, so both the G values in the Bayer matrix are equal to the G value in the RGB image.
You may not return an array representation of the resulting image. The output must be an image or a file (in any suitable image format) that can be displayed as an image.

Example

Given this file as an input:

The resulting image should be:

Reference python implementation:

from PIL import Image
import numpy
import sys

if len(sys.argv) == 1:
    print "Usage: python DeByer.py <<image_filename>>"
    sys.exit()

# Open image and put it in a numpy array
srcArray = numpy.array(Image.open(sys.argv[1]), dtype=numpy.uint8)
w, h, _ = srcArray.shape

# Create target array, twice the size of the original image
resArray = numpy.zeros((2*w, 2*h, 3), dtype=numpy.uint8)

# Map the RGB values in the original picture according to the BGGR pattern#

# Blue
resArray[::2, ::2, 2] = srcArray[:, :, 2]

# Green (top row of the Bayer matrix)
resArray[1::2, ::2, 1] = srcArray[:, :, 1]

# Green (bottom row of the Bayer matrix)
resArray[::2, 1::2, 1] = srcArray[:, :, 1]

# Red
resArray[1::2, 1::2, 0] = srcArray[:, :, 0]

# Save the imgage
Image.fromarray(resArray, "RGB").save("output.png")

Remember: this is a code-golf, so shortest code wins!

Matlab, 104 92 bytes

This makes use of the 3d-array/matrix representation of RGB images in Matlab, as well as the Kronecker product which is exactly what we need creating this new 2x2 "metapixel" form each source pixel. The output is then displayed in a popup window.

a=double(imread(input('')));for n=1:3;b(:,:,n)=kron(a(:,:,n),[1:2;2:3]==n)/255;end;imshow(b)

Resized screencapture:


Who's that probability distribution? Introduction

In this challenge, you are given a list of nonnegative floating point numbers drawn independently from some probability distribution.
Your task is to infer that distribution from the numbers.
To make the challenge feasible, you only have five distributions to choose from.

U, the uniform distribution on the interval [0,1].
T, the triangular distribution on the interval [0,1] with mode c = 1/2.
B, the beta distribution on the interval [0,1] with parameters α = β = 1/2.
E, the exponential distribution on the interval [0,∞) with rate λ = 2.
G, the gamma distribution on the interval [0,∞) with parameters k = 3 and θ = 1/6.

Note that all of the above distributions have mean exactly 1/2.

The Task

Your input is an array of nonnegative floating point numbers, of length between 75 and 100 inclusive.
Your output shall be one of the letters UTBEG, based on which of the above distributions you guess the numbers are drawn from.

Rules and Scoring

You can give either a full program or a function.
Standard loopholes are disallowed.

In this repository, there are five text files, one for each distribution, each exactly 100 lines long.
Each line contains a comma-delimited list of 75 to 100 floats drawn independently from the distribution and truncated to 7 digits after the decimal point.
You can modify the delimiters to match your language's native array format.
To qualify as an answer, your program should correctly classify at least 50 lists from each file.
The score of a valid answer is byte count + total number of misclassified lists.
The lowest score wins.

R, 202 192 184 182 162 154 bytes + 0 errors

function(x)c("U","T","B","E","G")[which.max(lapply(list(dunif(x),sapply(x,function(y)max(0,2-4*abs(.5-y))),dbeta(x,.5,.5),dexp(x,2),dgamma(x,3,6)),prod))]

This is based on the Bayesian formula P(D=d|X=x) = P(X=x|D=d)*P(D=d)/P(X=x), where D is the distribution and X is the random sample. We pick the d such that P(D=d|X=x) is greatest of the 5.

I assume a flat prior (i.e. P(D=di) = 1/5 for i in [1,5]), which means that P(D=d) in the numerator is the same in all cases (and the denominator would be the same in all cases anyways), so we can golf away everything but the P(x=X|D=d), which (except for the triangular distribution) simplify to native functions in R.

ungolfed:

function(x){
  u=prod(dunif(x))
  r=prod(sapply(x,function(y)max(0,2-4*abs(.5-y))))
  b=prod(dbeta(x,.5,.5))
  e=prod(dexp(x,2))
  g=prod(dgamma(x,3,6))
  den=.2*u+.2*r+.2*b+.2*e+.2*g
  c("U","T","B","E","G")[which.max(c(u*.2/den,r*.2/den,b*.2/den,e*.2/den,g*.2/den))]
}

Note that the ungolfed version is not exactly equivalent to the golfed version because getting rid of the denominator avoids the case of Inf/Inf which occurs if you allow the beta distribution to be over the closed interval [0,1] instead of (0,1) - as the sample data does. An additional if statement would handle that but since it's for illustrative purposes only it's probably not worth adding the complexity that is not at the heart of the algorithm.

Thanks @Alex A. for additional code reductions. Especially for which.max!


Japanese Encoding Conversion Background
In JIS X 0208 a 94 by 94 map (kuten (区点)) is defined to encode Chinese characters (kanji), phonetic moras (kana) and other symbols. Along with this standard there are 3 different encodings that maintain 1-1 correspondences with the map, namely JIS, Shift_JIS and EUC. These encodings take 2 bytes for each character in the kuten map. The mappings are different that random characters may occur (mojibake) if the wrong encoding is used.
Conversion Algorithm
In the formulae below, kuten is an ordered pair of numbers \$(区,点)\$ where \$1\le 区,点\le94\$, and \$(a,b)\$ is an ordered pair of bytes where \$0\le a,b\le 255\$. The conversions between kuten and the 3 encodings are as follows:
$$\text{JIS}: (a,b)=(32+区,32+点)$$
$$\text{Shift_JIS}: (a,b)=\begin{cases}
\left(128+\left\lceil\frac{区}{2}\right\rceil+64\left\lfloor\frac{区}{63}\right\rfloor,63+点+\left\lfloor\frac{点}{64}\right\rfloor\right)&\text{if }区\text{ is odd}\\
\left(128+\left\lceil\frac{区}{2}\right\rceil+64\left\lfloor\frac{区}{63}\right\rfloor,158+点\right)&\text{if }区\text{ is even}
\end{cases}$$
$$\text{EUC}: (a,b)=(160+区,160+点)$$
Challenge
Write a program or function that, given a byte pair, the source encoding and the destination encoding, converts the byte pair from the source encoding to the destination encoding and outputs the result. You may assume that the input byte pair represents a valid codepoint in the source encoding.
The input and output formats are flexible and are accepted if reasonable. For example, you may receive or output the byte pair as a list, as two numbers or as a number, either in decimal or hexadecimal; you may also assign a number to each of the possible encodings and use them as the input format of the encodings.
Sample IO
The format used in the samples is SrcCodePoint, SrcEncoding, DstEncoding -> DstCodePoint. Decimal is used here but hexadecimal is also acceptable. The Unicode character and its assigned kuten are for explanation.
(227, 129), Shift_JIS, EUC -> (229, 225) (Kuten: 69-65; U+7E3A 縺)
(101, 98), JIS, Shift_JIS  -> (227, 130) (Kuten: 69-66; U+7E67 繧)
(229, 227), EUC, JIS       -> (101, 99)  (Kuten: 69-67; U+7E5D 繝)
(137, 126), Shift_JIS, JIS -> (49, 95)   (Kuten: 17-63; U+5186 円)
(177, 224), EUC, Shift_JIS -> (137, 128) (Kuten: 17-64; U+5712 園)
(49, 97), JIS, EUC         -> (177, 225) (Kuten: 17-65; U+5830 堰)

See here (in Japanese) for the full table.
Winning condition
This is a code-golf challenge, so the shortest valid submission for each language wins. Standard loopholes are forbidden by default.

Ruby, 140 116 bytes

Takes code point as an array, and encodings are JIS, Shift_JIS, and EUC-JP, respectively.

Ruby supports converting between EUC-JP and SHIFT_JIS, so we math JIS encoding into EUC, perform the appropriate conversion, then math back the JIS encoding if that's the destination encoding.

-34 bytes by getting permission to take EUC input as EUC-JP.

->c,s,d{(c.map!{|e|e+=128};s="EUCJP")if s=~r=/^J/
c.pack('c*').encode(d[r]?"EUCJP":d,s).bytes.map{|e|e-=d[r]?128:0}}

Try it online!

Explanation

->c,s,d{                                            # Function that takes 3 parameters
        (                           )if s=~r=/^J/   # If s is JIS: (starts with J)
                                                    #  (also store this regex for later)
         c.map!{|e|e+=128};                         # Add 128 to each codepoint
                           s="EUCJP"                # Change s to EUC-JP locale
  c.pack('c*')                                      # Pack codepoints into bytestring
    .encode(                                        # Encode the bytestring as follows:
                                                    #  Destination encoding is:
      d[r]?"EUCJP":d,                               #   If d is JIS, use EUC-JP instead
      s                                             #  Source encoding
    )
    .bytes                                          # Convert to bytes
    .map{|e|e-=d[r]?128:0}                          # If d is JIS, subtract 128
}

Pure Math Version, 164 162 bytes

Takes code points separately, and the encodings are integers: 0=JIS, 1=SHIFT_JIS, 2=EUC.

-2 bytes from Jonathan Allen.

->a,b,s,d,e=160{k,t=[[a-32,b-32],[a*2-1+b/158-(2+a/222)*128,b-63-b/128-b/158*94],[a-e,b-e]][s]
[[k+32,t+32],[128+k/2+k%2+k/63*64,158+t+t/64-k%2*95],[k+e,t+e]][d]}

Try it online!


Jelly, 18 bytes

ṣ”#L€ṙ-I%127”;ẋp”$

Try it online!

How it works

ṣ”#L€ṙ-I%127”;ẋp”$  Main link. Argument: s (string)

ṣ”#L€               Split s at hashes. Take the length of each resulting chunk.
     ṙ-             Rotate the result -1 units to the left / 1 unit to the right.
                    Since s won't have trailing semicola, the length of the last
                    chunk will be 0. Rotating moves this 0 to the beginning.
       I            Increments; take all forward differences. Because of the 0 we
                    removed to the beginning, the first forward difference will be
                    the length of the first chunk.
        %127        Take the differences modulo 127. In Python, `n % d' is either 0
                    or has the same sign as d, so this reports how many semicola
                    are needed to get from one code point to the next one.
            ”;ẋ     Repeat ';' k times, for each modulus k.
               p”$  Take the Cartesian product with "$", appending '$' to each run
                    of semicola.


Search text for a prefix and list all its suffixes in the text I use "suffix" loosely here to mean "any sub-string that follows the prefix".

"Prefix" here means the START of a word, where a word's start is defined as either after a space or from the first character of the input text (for the first word). A "prefix" in the middle of a word is ignored.

E.g. if your input prefix is "arm" and the input text is "Dumbledore's army was fully armed for the impending armageddon" then the output list contains (y, ed, ageddon).

Test Cases

Assume case-sensitive, strings end after spaces. Input will not start with a space.

Removing duplicates is optional.

Input prefix: "1"

Input text:

"He1in aosl 1ll j21j 1lj2j 1lj2 1ll l1j2i"

Output: (ll, lj2j, lj2) - in any permutation

Input prefix: "frac"

Input text:

"fracking fractals fracted fractional currency fractionally fractioned into fractious fractostratic fractures causing quite a fracas"

Output: (king, tals, ted, tional, tionally, tioned, tious, tostratic, tures, as)

Input prefix: "href="https://www.astrotheme.com/astrology/"

Input text:

"(div style="padding: 0; background: url('https://www.astrotheme.com/images/site/arrondi_450_hd.png') no-repeat; text-align: left; font-weight: bold; width: 450px; height: 36px")
  (div class="titreFiche" style="padding: 5px 0 0 6px")(a href="https://www.astrotheme.com/astrology/Nolwenn_Leroy" title="Nolwenn Leroy: Astrology, birth chart, horoscope and astrological portrait")Nolwenn Leroy(br /)
(/div)
  (div style="text-align: right; border-left: 1px solid #b2c1e2; border-right: 1px solid #b2c1e2; width: 446px; padding: 1px 1px 0; background: #eff8ff")
    (table style="width: 100%")(tr)(td style="width: 220px")
(div style="padding: 0; background: url('https://www.astrotheme.com/images/site/arrondi_450_hd.png') no-repeat; text-align: left; font-weight: bold; width: 450px; height: 36px")
  (div class="titreFiche" style="padding: 5px 0 0 6px")(a href="https://www.astrotheme.com/astrology/Kim_Kardashian" title="Kim Kardashian: Astrology, birth chart, horoscope and astrological portrait")Kim Kardashian(br /)(span style="font-weight: normal; font-size: 11px")Display her detailed horoscope and birth chart(/span)(/a)(/div)
(/div)
(div style="padding: 0; background: url('https://www.astrotheme.com/images/site/arrondi_450_hd.png') no-repeat; text-align: left; font-weight: bold; width: 450px; height: 36px")
  (div class="titreFiche" style="padding: 5px 0 0 6px")(a href="https://www.astrotheme.com/astrology/Julia_Roberts" title="Julia Roberts: Astrology, birth chart, horoscope and astrological portrait")Julia Roberts(br /)(span style="font-weight: normal; font-size: 11px")Display her detailed horoscope and birth chart(/span)(/a)(/div)
    (td id="cfcXkw9aycuj35h" style="text-align: right")
  (/div)"

Output: (Nolwenn_Leroy", Kim_Kardashian", Julia_Roberts")

The Winner

This is code-golf, so the fewest bytes wins. :)

Can accept the inputs in any way that works, as long as your code can solve arbitrary problems like the test cases.

R, 63 bytes

function(s,p,z=el(strsplit(s,' ')))sub(p,'',z[startsWith(z,p)])

Try it online!

The positive-lookbehind implementation is unfortunately 5 bytes longer due to the huge regmatches/gregexpr combination :

function(s,p)regmatches(s,gregexpr(paste0('(?<=',p,')[^ ]*'),s,,T))


Lemon-Limify a String Write a program or function that takes in a nonempty single-line string. You may assume it only contains printable ASCII excluding space.

Print or return an ASCII art lozenge shape similar to a lemon or lime made from the prefixes of the string.

Suppose the input string is n letters long. Then, such a shape consists of 2n − 1 columns of ASCII art stitched together, each consisting of 2n − 1 lines. Counting from 1, the k-th column is f(k) = min(k, 2n − k) characters wide, and contains f(k) copies of the first f(k) characters of input, centered vertically, with single blank lines separating the copies.

For example, if the input is Lemon, the output should be:

          Lemon
      Lemo     Lemo
   Lem    Lemon    Lem
 Le   Lemo     Lemo   Le
L  Lem    Lemon    Lem  L
 Le   Lemo     Lemo   Le
   Lem    Lemon    Lem
      Lemo     Lemo
          Lemon

If the input is lime the output should be:

      lime
   lim    lim
 li   lime   li
l  lim    lim  l
 li   lime   li
   lim    lim
      lime

And the same pattern is followed for other inputs:

a

a

Be

 Be
B  B
 Be

/\

 /\
/  /
 /\

cat

   cat
 ca   ca
c  cat  c
 ca   ca
   cat

|||

   |||
 ||   ||
|  |||  |
 ||   ||
   |||

.__.

      .__.
   .__    .__
 ._   .__.   ._
.  .__    .__  .
 ._   .__.   ._
   .__    .__
      .__.

$tring

               $tring
          $trin      $trin
      $tri     $tring     $tri
   $tr    $trin      $trin    $tr
 $t   $tri     $tring     $tri   $t
$  $tr    $trin      $trin    $tr  $
 $t   $tri     $tring     $tri   $t
   $tr    $trin      $trin    $tr
      $tri     $tring     $tri
          $trin      $trin
               $tring

Lines in the output may have trailing spaces and there may be one optional trailing newline.

The shortest code in bytes wins.

Matlab, 140 136 128 124 bytes
Basically first starts with the middle section, and then prepends/appends the shortened/modified versions step by step.
a=input('');v=ones(nnz(a)*2-1,1)*a;v(2:2:end,:)=0;b=v;for k=a;v=v(2:end,1:end-1);v(end+1,:)=0;b=[v,b,v,''];end;b(~flip(b))=0

Thanks for 8 bytes @LuisMendo!
E.g. for MATLAB we get:
               MATLAB
          MATLA      MATLA
      MATL     MATLAB     MATL
   MAT    MATLA      MATLA    MAT
 MA   MATL     MATLAB     MATL   MA
M  MAT    MATLA      MATLA    MAT  M
 MA   MATL     MATLAB     MATL   MA
   MAT    MATLA      MATLA    MAT
      MATL     MATLAB     MATL
          MATLA      MATLA
               MATLAB


Count the crossing words Consider the following standard 15×15 crossword puzzle grid.

We can represent this in ASCII art by using # for blocks and  (space) for white squares.

     #    #
     #    #
          #
   #   #
###     ##   ##

     ##   #
   #       #
    #   ##

##   ##     ###
       #   #
    #
    #    #
    #    #

Given a crossword grid in the ASCII art format above, determine how many words it holds. (The above grid has 78 words. It happens to be last Monday's New York Times puzzle.)

A word is a group of two or more consecutive spaces running vertically or horizontally. A word starts and ends with either a block or the edge of the grid and always runs top to bottom or left to right, never diagonally or backwards. Note that words can span the whole width of the puzzle, as in the sixth row of the puzzle above. A word does not have to be connected to another word.

Details

Input will always be a rectangle containing the characters # or  (space), with rows separated by a newline (\n). You can assume the grid is made of any 2 distinct printable ASCII characters instead of # and .
You may assume there is an optional trailing newline. Trailing space characters DO count, as they affect the number of words.
The grid will not always be symmetrical, and it may be all spaces or all blocks.
Your program should theoretically be able to work on a grid of any size, but for this challenge it will never be larger than 21×21.
You may take the grid itself as input or the name of a file containing the grid.
Take input from stdin or command line arguments and output to stdout.
If you prefer, you may use a named function instead of a program, taking the grid as a string argument and outputting an integer or string via stdout or function return.

Test cases

Input:

    #
    #
    #

Output: 7 (There are four spaces before each #. The result would be the same if each number sign were removed, but Markdown strips spaces from otherwise empty lines.)
Input:

##
 #
##

Output: 0 (One-letter words don't count.)
Input:

######
#    #
  ####
# ## #
# ## #
#### #

Output: 4
Input: (May 10's Sunday NY Times puzzle)

   #    ##   #
   #    #    #
   #         #
       #     ###   ##
    #       #
##   #   #
        #       ##
      #   ##
   #        ##      #
         #   ###   ##
#   ##         ##   #
##   ###   #
#      ##        #
         ##   #
   ##       #
           #   #   ##
        #       #
##   ###     #
       #         #
       #    #    #
       #   ##    #

Output: 140

Scoring

Shortest code in bytes wins. Tiebreaker is oldest post.

Slip, 18 + 3 = 21 bytes

>? ( +(X|$^)<<){2}

Run with the flags no (hence the +3), and uses space/X instead of space/#. Annoyingly this is longer than CJam/Pyth, but I guess Slip wasn't designed to be particular golfy...

Try it online. Note that the first example is missing spaces on a few lines.

Explanation

>?           Optionally turn right, hence matching either horizontally or vertically
[space]      Match a space
(    ){2}    Group, twice:
[space]+       Match 1+ spaces
(X|$^)         Either an X or the boundary of the grid
<<             Reverse the match pointer by turning left twice

The n flag makes output print the number of matches, and the o flag enables overlapping matches starting from the same square. The reason for the back-and-forth is because Slip tries matches starting from every square, and we want to make sure we only match a full row rather than a partial one. Slip only returns unique matches, even if they started from different positions.

Note: Originally I had >?(  +(X|$^)<<){2}, with the first space on the inside. This would miss some cases with 2 space long words at the edge, since the pointer would go like this:

XXX       XXX       XXX       XXX
X>        X >       X<        <
XXX       XXX       XXX       XXX

[sp]    [sp]+$^    <<[sp]    [sp]+   (uh oh match fails)


Restricted-source, take this! a.k.a. You Can Output Anything With Labyrinth Or Hexagony™
Challenge
In a recent restricted-source challenge, I could print any character with only half of the allowed digits with very small character count, by abusing the "digit commands" and modulo-256 output function. Now, it's about time to make a general metagolfer for this kind of challenges.
For the sake of simplicity, we only consider Labyrinth programs of the form <digits>.@, i.e. construct a number, print it modulo 256 as character code, and halt. Also, the sequence of digits acts exactly like a number literal in this case.
Now let's assume we want to solve a restricted-source challenge in the form of:

Given the characters .@ and a subset of 0-9, print a character.

Given a subset of digits D and the target character c, find the shortest number N which will solve the hypothetical challenge above. In other words, N should satisfy the following:

All the digits of N are in D.
The Labyrinth program N.@ prints the character c, i.e. N % 256 == ord(c).

The byte value of c can be anything between 1 and 255 inclusive.

Out of all possible Ns satisfying the above, your program should output one that has the shortest length. If there are multiple possible answers, your program is free to output any of them.

You may take c as a character or an integer (charcode), and digits in D as integers or digit characters. Also, you may assume D is already sorted.
Assume the answer exists. Note that some conditions will lead to "no answer", e.g. only odd digits are allowed but you need to print an even character, or vice versa. You may assume that such conditions will never be given as input.
Standard code-golf rules apply. The shortest code in bytes wins.
Test cases
The value of c is given as its character code.
D = [1, 2, 3, 4, 5]
c = 1 => N = 1
c = 57 => N = 313
c = 254 => N = 254
c = 100 => N = 1124 or 4452
c = 107 => N = 1131, 2155, 2411, or 3435

D = [1, 2, 4, 6, 8]
c = 58 => N = 826
c = 71 => N = 1111111
c = 255 => N = 26111

D = [7]
c = 49 => N = 777777

JavaScript (ES6), 46 bytes
Saved 6 bytes thanks to @Neil
Expects (D)(c), where D is a string of digits and c is an integer.

D=>c=>eval(`for(;/[^${D}]/.test(c);)c+=256;c`)

Try it online!


Levenshtein Neighbours Most square numbers have at least 1 different square number with which their Levenshtein distance is exactly 1. For a given square \$x\$, each square that meets this condition is called a Levenshtein neighbour of \$x\$. For example, \$36\$ is a Levenshtein neighbour of \$16\$, as only 1 edit (\$1 \to 3\$) is required. However, \$64\$ is not a Levenshtein neighbour of \$16\$, as it requires a minimum of 2 edits. Numbers that have leading 0s (\$2025 \to 025\$) are not Levenshtein neighbours.

Your task is to take a square number as input and to output, in any reasonable format, the complete list of it's Levenshtein neighbours. You may include repeat neighbours in the list, if you wish, but you may not include the original input, as it isn't a Levenshtein neighbour of itself.

Any reasonable format should include some sort of separator between the outputs, such as , or a newline, and can output characters with the corresponding Unicode value (i.e. brainfuck) rather than the numbers themselves. The order of the output doesn't matter.

This input will always be a square number, greater than \$0\$. Your program should have no theoretical limit, but if it fails for large numbers for practical reasons (e.g. beyond 32-bit numbers), that's completely fine.

If the input does not have any Levenshtein neighbours, the output must clearly reflect this, such as outputting nothing, an empty array/string, a negative integer, \$0\$, etc.

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

Test cases

These are the results for the squares of \$1\$ through to \$20\$:

  1: 4, 9, 16, 81
  4: 1, 9, 49, 64
  9: 1, 4, 49
 16: 1, 36, 169, 196
 25: 225, 256, 625
 36: 16, 361
 49: 4, 9
 64: 4
 81: 1, 841
100: 400, 900, 1600, 8100
121: 1521
144: 1444
169: 16, 1369
196: 16, 1296, 1936
225: 25, 625, 1225, 2025, 4225, 7225
256: 25
289: 2809
324: 3249
361: 36, 961
400: 100, 900, 4900, 6400

In addition, 1024 does not have any neighbours, so is a good test case.

05AB1E,  11 10  6 bytes
-4 thanks to Grimy !! (square first rather than looking for squares saves 3; use 10^n saves 1)
°Lnʒ.L

Takes an integer, outputs a, possibly empty, list
Try it online! - This is crazy-slow due to the °, so no point trying it even for 9.
Or Try a slightly faster version - This one adds eight instead with 8+ then uses the same approach.
How?
°Lnʒ.L - f(integer)    stack = n
°      - push 10^n             10^n
 L     - range                 [1,2,3,...,10^n]
  n    - square                [1,4,9,...,10^2n]
   ʒ   - filter keep if == 1:
    .L -   Levenshtein distance


LCM of Rational Numbers The least common multiple (LCM) of a set of numbers A is the smallest integer b such that b/a is an integer for all integers a in A. This definition can be extended to rational numbers!
Task
Find the smallest positive rational b such that b/a is an integer for all rationals a in the input.
Rules

Standard loopholes are forbidden.
You may take numerators and denominators separately in the input, but may not take doubles, floats, etc.
The input may not be fully reduced.
You may take integer inputs as rationals with denominator of 1.
Submissions that would feed rational numbers to an LCM/GCD builtin are allowed, but non-competing.

Test Cases
In:  3
Out: 3

In:  1/17
Out: 1/17

In:  1/2, 3/4
Out: 3/2

In:  1/3, 2/8
Out: 1

In:  1/4, 3
Out: 3

In:  2/5, 3
Out: 6

In:  1/2, 3/4, 5/6, 7/8
Out: 105/2

This is code-golf, so submissions using the fewest bytes win!

J, 3 bytes, non-competing.

*./

Given a list of rational inputs, this folds LCM through it.


Wait a minute – in less than ten seconds Task

Using any type of parallelisation, wait multiple periods, for a total sleep time of at least a minute (but less than a minute and a half).

The program/function must terminate within 10 seconds and return (by any means and in any format) two values: the total elapsed time, and the total executed sleep time. Both time values have to have a precision of at least 0.1 seconds.

This is similar to the concept of man-hours: a job that takes 60 hours can be completed in only 6 hours if 10 workers are splitting the job. Here we can have 60 seconds of sleep time e.g. in 10 parallel threads, thus requiring only 6 seconds for the whole job to be completed.

Example

The program MyProgram creates 14 threads, each thread sleeps for 5 seconds:

MyProgram → [5.016,70.105]

The execution time is greater than 5 seconds, and the total sleep time is greater than 70 seconds because of overhead.

Python 2, 172 bytes
import threading as H,time as T
m=T.time
z=H.Thread
s=m()
r=[]
def f():n=m();T.sleep(9);f.t+=m()-n
f.t=0
exec"r+=[z(None,f)];r[-1].start();"*8
map(z.join,r)
print m()-s,f.t

This requires an OS with time precision greater than 1 second to work properly (in other words, any modern OS). 8 threads are created which sleep for 9 seconds each, resulting in a realtime runtime of ~9 seconds, and a parallel runtime of ~72 seconds.
Though the official documentation says that the Thread constructor should be called with keyword arguments, I throw caution to the wind and use positional arguments anyway. The first argument (group) must be None, and the second argument is the target function.
nneonneo pointed out in the comments that attribute access (e.g. f.t) is shorter than list index access (e.g. t[0]). Unfortunately, in most cases, the few bytes gained from doing this would be lost by needing to create an object that allows user-defined attributes to be created at runtime. Luckily, functions support user-defined attributes at runtime, so I exploit this by saving the total time in the t attribute of f.
Try it online
Thanks to DenkerAffe for -5 bytes with the exec trick.
Thanks to kundor for -7 bytes by pointing out that the thread argument is unnecessary.
Thanks to nneonneo for -7 bytes from miscellaneous improvements.


Now I know my ABCs, won't you come and golf with me? Write a program or function that outputs this exact text, case-insensitive:

A, B, C, D, E, F, G,
H, I, J, K, L, M, N, O, P,
Q, R, S,
T, U, V,
W, X, Y, Z.

(Based on the alphabet song that many American kids learn to help memorize the alphabet, though edited for more compressibility.)

The output must look exactly the same as the above (again, case-insensitive), but may contain trailing spaces on each line and/or trailing newlines. Notice the period at the end.

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

Vim, 42, 40 keystrokes/bytes
:h<_<cr>jjYZZP:s/./&, /g<cr>7f r<cr>9;.3;.3;.$ch.

Thanks to Lynn and her awesome vim answer for the tip to grab the alphabet from help.
Thanks to RomanGräf for saving two bytes!
Explanation:
:h<_<cr>                                      " Open up vim-help
        jj                                    " Move down two lines
          Y                                   " Yank this line (containing the alphabet)
           ZZ                                 " Close this buffer
             P                                " Paste the line we just yanked
              :s/./&, /g<cr>                  " Replace every character with that character followed by a comma and a space
                            7f                " Find the seven space on this line
                               r<cr>          " And replace it with a newline
                                    9;        " Repeat the last search (space) 9 times
                                      .       " Repeat the last edit (replace with a newline)
                                       3;     " Third space
                                         .    " Replace with newline
                                          3;  " Third space
                                            . " Replace with newline

Then, we move the end of the of the line with $, change back a character with ch and insert a dot.


Implement tab completion Tab completion is a useful feature that auto-completes partially written commands.  You're going to be implementing it.
For example, if the available commands were ['apply','apple','apple pie','eat'], then a would complete to  appl, as all of the commands that start with a also start with appl.
Input/Output
You need to input a string, A, and a set of strings, B.
You need to output the longest common prefix of all B that starts with A.

If none of the options starts with A, then return A
You can assume that B is nonempty, and that all strings are nonempty
You cannot assume that any of the options start with A, nor that the common prefix will be longer than A
You can be case sensitive or case insensitive.
You only need to handle printable ASCII
Built-ins that explicitly do this task are allowed

Test cases:
'a'       ['apply','apple','apple pie','eat'] => 'appl'
'a'       ['apple pie']                       => 'apple pie'
'apple'   ['eat','dine']                      => 'apple'
'program' ['programa','programb']             => 'program'
'*%a('    ['*%a()-T>','*%a()-T<','@Da^n&']    => '*%a()-T'
'a'       ['abs','absolute','answer']         => 'a'
'a'       ['a','abs']                         => 'a'
'one to'  ['one to one','one to many']        => 'one to '

Note the trailing space on the last test case
This is a code-golf, so make your answers as short as possible!

JavaScript (ES6), 75 bytes

(s,a)=>/^(.*).*(\n\1.*)*$/.exec(a.filter(e=>e.startsWith(s)).join`
`)[1]||s

Explanation: Filters on all matching prefixes, then joins with newlines and matches against a regex that finds the longest common prefix of all lines. If there are no prefixes then the regex returns an empty string in which case we simply return the original string.


Golf me an ASCII Alphabet Don't you find that reading simple text isn't appealing enough? Try our

#####  ###   ###  ##### #####       ##### ##### #   # #####   #
#   # #     #   #   #     #           #   #      # #    #     #
#####  ###  #       #     #           #   ####    #     #     #
#   #     # #   #   #     #           #   #      # #    #
#   #  ###   ###  ##### #####         #   ##### #   #   #     #

Much more fancy isn't it? But it's pretty long to write by hand, it would be wonderful if someone did a program that do it for me !

Your task, if you volunteer to help me, will be to write a program or a function that takes a string containing [a-zA-Z\s\n] only, and output (or return) the ascii writing of it!

You must use the following alphabet to format your output:

##### ####   ###  ####  ##### #####  ###  #   # ##### ##### #   # #     #   #
#   # #   # #   # #   # #     #     #     #   #   #     #   #  #  #     ## ##
##### ####  #     #   # ####  ####  #  ## #####   #     #   ###   #     # # #
#   # #   # #   # #   # #     #     #   # #   #   #   # #   # #   #     #   #
#   # ####   ###  ####  ##### #      ###  #   # ##### ###   #  #  ##### #   #

#   #  ###  ####   ###  ####   ###  ##### #   # #   # #   # #   # #   # #####
##  # #   # #   # #   # #   # #       #   #   # #   # #   #  # #   # #     #
# # # #   # ####  #   # ####   ###    #   #   #  # #  # # #   #     #     #
#  ## #   # #     #  ## ##        #   #   #   #  # #  ## ##  # #    #    #
#   #  ###  #      #### # #    ###    #    ###    #   #   # #   #   #   #####

The space:

     |
     | it's a 5x5 square of spaces
     | but had to pad it with |s to make it appear in this post
     |
     |

As this is a fixed-width font, the space character is also surrounded by spaces, resulting in a 7-width space between the two letters.

a b
     1234567       -- these numbers are just for the example, you don't have to output them
#####       ####
#   #       #   #
#####       ####
#   #       #   #
#   #       ####

a  b
     1234567890123
#####             ####
#   #             #   #
#####             ####
#   #             #   #
#   #             ####

When you encounter a newline, as in the input

ascii
text

Just make sure to separate the two blocks of text by at least one empty line

#####  ###   ###  ##### #####
#   # #     #   #   #     #
#####  ###  #       #     #
#   #     # #   #   #     #
#   #  ###   ###  ##### #####

##### ##### #   # #####
  #   #      # #    #
  #   ####    #     #
  #   #      # #    #
  #   ##### #   #   #

Also, you are allowed to replace the #s with any other character as long as it is in the printable ASCII range, and is not spaces. You could for instance use As for the letter A, B for the letter B and so on.

As this is code-golf (and moreover kolmogorov-complexity) the winning submission will be the one that solve this challenge in the least byte possible, have fun!

Python 3, 375 bytes
f=lambda i:"\n\n".join("\n".join(map(" ".join,zip(*[[x.replace("0"," ")[a*5:a*5+5]for a in range(5)]for x in[["{:025b}".format(int(c,36))for c in'0 JPCFL J2UKE 92Y3Y J2KAM JOMCF JOMC0 92B72 AYP81 JFM3J JFMHO AZC7M AB6ZJ B5I5T B43N5 92YWE J2UJ4 92YY7 J2UQC 926UM JFM2S AYE5Q AY8G4 AYHKH AT6Q9 AT6KK AWU7'.split()][x!=" "and ord(x)-64]for x in j.upper()]])))for j in i.split("\n"))

See this code running on ideone.com.
The same code, but somehow nicely indented, formatted and commented:
f = lambda i: \

    # join multiline strings together using an empty line as separator:
    "\n\n".join(

        # join the string lines of one big output line together:
        "\n".join(

            # join the corresponding rows of the letters together using " ":
            map(" ".join, zip(*

                # make a list (output line) of list (output characters)
                # of strings (single character's rows):
                [

                    # replace 0s with spaces and split the bit strings into
                    # chunks of 5 characters - the rows of each letter:
                    [x.replace("0", " ")[a*5 : a*5+5] for a in range(5)]

                    for x in [

                        # split the space separated character codes and
                        # convert them from base 36 to
                        # base 2 strings of length 25:
                        ["{:025b}".format(int(c, 36)) for c in

                         # the encoded font data (reformatted):
                         '0 JPCFL J2UKE 92Y3Y J2KAM JOMCF JOMC0 92B72 '
                         'AYP81 JFM3J JFMHO AZC7M AB6ZJ B5I5T B43N5 92YWE '
                         'J2UJ4 92YY7 J2UQC 926UM JFM2S AYE5Q AY8G4 AYHKH '
                         'AT6Q9 AT6KK AWU7'.split()]

                        # select element 0 if we want a space, else find
                        # out the index from the ASCII code of the letter:
                        [x != " " and ord(x) - 64]

                        # repeat for every character in the input line:
                        for x in j.upper()
                    ]
                ]
            ))

        # repeat for every line in the input
        ) for j in i.split("\n")
    )

I also decided to go for base 36 encoding as that's the highest base Python's built-in int() natively supports. Here is a short Python 3 script I wrote (ungolfed) that converts font definitions like in the question into base 36 codes: My converter on ideone.com
The result consists of the character 1 as enabled pixel and a space   as disabled pixel. Here's a single example run:
Input (line break as \n):
Hello World
Python rocks

Output:
1   1 11111 1     1      111        1   1  111  1111  1     1111
1   1 1     1     1     1   1       1   1 1   1 1   1 1     1   1
11111 1111  1     1     1   1       1 1 1 1   1 1111  1     1   1
1   1 1     1     1     1   1       11 11 1   1 11    1     1   1
1   1 11111 11111 11111  111        1   1  111  1 1   11111 1111

1111  1   1 11111 1   1  111  1   1       1111   111   111  1   1  111
1   1  1 1    1   1   1 1   1 11  1       1   1 1   1 1   1 1  1  1
1111    1     1   11111 1   1 1 1 1       1111  1   1 1     111    111
1       1     1   1   1 1   1 1  11       11    1   1 1   1 1 1       1
1       1     1   1   1  111  1   1       1 1    111   111  1  1   111


Stack Exchange Vote Counter Write a program/function that returns the vote count of its own Stack Exchange answer at the time of its execution.

Your program/function may access this page (codegolf.stackexchange.com/questions/82609) off the internet, however:
Your program/function may not accept any user input and
The use of URL shorteners is not allowed
Your program/function may use only its own source as a reference point to its vote count (for example: no referencing strings of text in its contained answer but not in its own source)
Your program/function must output its own vote count and only its own vote count (for example: no returning all vote counts on this page)

This is code-golf, shortest code wins.

jQuery + JavaScript, 85 bytes

$.get("//api.stackexchange.com/posts/82610?site=codegolf",d=>alert(d.items[0].score))
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>

History

-6 bytes because I was using the var data instead of d.
-3 bytes thanks to @msh210
-13 bytes thanks to @CᴏɴᴏʀO'Bʀɪᴇɴ
-4 bytes thanks to @user6188402
-5 bytes thanks to @Suever
-4 bytes thanks to @RobW

Recommended usage

Run snippet.
Upvote.
Run snippet, and be amazed as the number magically increases.

Bonus!!

Who doesn't like a bonus?

$.getJSON("//api.stackexchange.com/posts/" + prompt() + "?site=codegolf",d=>alert(d.items[0].score));
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>

Enter the ID into the bonus and it will tell you the score.

Even more bonus!! Run this snippet to automatically run the program, upvote, and run again! (Requires rep > 15, auth). If it doesn't work, please tell me.


Generate the minimal remainder sequence Every number can be represented using an infinitely long remainder sequence.  For example, if we take the number 7, and perform 7mod2, then 7mod3, then 7mod4, and so on, we get 1,1,3,2,1,0,7,7,7,7,.....
However, we need the shortest possible remainder subsequence that can still be used to distinguish it from all lower numbers.  Using 7 again, [1,1,3] is the shortest subsequence, because all of the previous subsequences don't start with [1,1,3]:
0: 0,0,0,0...
1: 1,1,1,1...
2: 0,2,2,2...
3: 1,0,3,3...
4: 0,1,0,4...
5: 1,2,1,0...
6: 0,0,2,1...

Note that [1,1] doesn't work to represent 7, because it can also be used to represent 1.  However, you should output [1] with an input of 1.
Input/Output
Your input is a non-negative integer.  You must output a sequence or list of the minimal-length sequence of remainders as defined above.
Test cases:
0: 0
1: 1
2: 0,2
3: 1,0
4: 0,1
5: 1,2
6: 0,0,2
7: 1,1,3
8: 0,2,0
9: 1,0,1
10: 0,1,2
11: 1,2,3
12: 0,0,0,2
30: 0,0,2,0
42: 0,0,2,2
59: 1,2,3,4
60: 0,0,0,0,0,4
257: 1,2,1,2,5,5
566: 0,2,2,1,2,6,6
1000: 0,1,0,0,4,6,0,1
9998: 0,2,2,3,2,2,6,8,8,10
9999: 1,0,3,4,3,3,7,0,9,0

Here are the first 10,000 sequences, in case you are interested (the line numbers are off by 1).
This is a code-golf, so make it as short as you can in your favorite language.  Fake bonus points for any answers that are fast!

Jelly, 14 bytes

‘Ræl\>iṠ2»2r⁸%

This uses the fact a the solution (if any) of a system of linear congruences is unique modulo the LCM of the moduli. Try it online! or verify all test cases.

How it works

‘Ræl\>iṠ2»2r⁸%  Main link. Argument: n

‘               Increment; yield n+1.
 R              Range; yield [1, ..., n+1].
  æl\           Cumulatively reduce by LCM.
                This yields [LCM(1), ..., LCM(1, ..., n+1)].
     >          Compare all LCMs with n.
      iṠ        Find the first index of sign(n).
                This yields the first m such that LCM(2, ..., m) > n if n > 0, and
                0 if n == 0.
        2»      Take the maximum of the previous result and 2, mapping 0 to 2.
          2r    Yield the range from 2 up to and including the maximum.
            ⁸%  Compute n modulo each integer in that range.


Given a list of circles, output the area of the smallest containing rectangle You will be given a list of radii, you must output the area of the smallest rectangle which they will all fit in.

For example, given the list [5,3,1.5] you would output 157.460.

This is the image:

The width is 15.7460 and the height is 10, so the area is 157.460

Rules:

You get the list via stdin or function argument, output the answer via stdout or function return.
The radii will have at most 2 decimal places.
The list will have a length between 2 and 6.
The output should be accurate to 3 decimal places or more.
If you need, π = 3.1416.

Test cases:

[5,3,1.5] = 157.460
[9,4,8,2] = 733.431 - working here.
[18,3,1] = 1296.000

Shortest code in bytes wins.

Python 2 + PySCIPOpt, 267 bytes

from pyscipopt import*
R=input()
m=Model()
V,C=m.addVar,m.addCons
a,b,c=V(),V(),V()
m.setObjective(c)
C(a*b<=c)
P=[]
for r in R:
 x,y=V(),V();C(r<=x);C(x<=a-r);C(r<=y);C(y<=b-r)
 for u,v,s in P:C((x-u)**2+(y-v)**2>=(r+s)**2)
 P+=(x,y,r),
m.optimize()
m.printBestSol()

How it works

We write the problem as follows: minimize c over variables a, b, c, x1, y1, …, xn, yn, where

ab ≤ c;
ri ≤ xi ≤ a − ri and ri ≤ yi ≤ b − yi, for 1 ≤ i ≤ n;
(xi − xj)2 + (yi − yj)2 ≥ (ri + rj)2, for 1 ≤ j < i ≤ n.

Obviously, we’re using an external optimization library on these constraints, but you can’t just feed them to any old optimizer—even Mathematica’s NMinimize gets stuck at local minima for these tiny test cases.  If you stare closely at the constraints, you’ll see that they constitute a quadratically-constrained quadratic program, and finding the global optimum for a non-convex QCQP is NP-hard.  So we need some incredibly high-powered magic.  I chose the industrial-strength solver SCIP, which is the only global QCQP solver I could find with so much as a free license for academic use.  Happily, it has some very nice Python bindings.

Input and output

Pass the radius list on stdin, like [5,3,1.5].  The output shows objective value: rectangle area, x1, x2 rectangle dimensions, x3 rectangle area again, x4, x5 first circle center coordinates, x6, x7 second circle center coordinates, etc.

Test cases

[5,3,1.5] ↦ 157.459666673757

SCIP Status        : problem is solved [optimal solution found]
Solving Time (sec) : 0.04
Solving Nodes      : 187
Primal Bound       : +1.57459666673757e+02 (9 solutions)
Dual Bound         : +1.57459666673757e+02
Gap                : 0.00 %
objective value:                     157.459666673757
x1                                                 10   (obj:0)
x2                                   15.7459666673757   (obj:0)
x3                                   157.459666673757   (obj:1)
x4                                                  5   (obj:0)
x5                                                  5   (obj:0)
x6                                                  7   (obj:0)
x7                                   12.7459666673757   (obj:0)
x8                                                1.5   (obj:0)
x9                                   10.4972522849871   (obj:0)

[9,4,8,2] ↦ 709.061485909243

This is better than the OP’s solution.  The exact dimensions are 18 by 29 + 6√3.

SCIP Status        : problem is solved [optimal solution found]
Solving Time (sec) : 1.07
Solving Nodes      : 4650
Primal Bound       : +7.09061485909243e+02 (6 solutions)
Dual Bound         : +7.09061485909243e+02
Gap                : 0.00 %
objective value:                     709.061485909243
x1                                                 18   (obj:0)
x2                                   39.3923047727357   (obj:0)
x3                                   709.061485909243   (obj:1)
x4                                                  9   (obj:0)
x5                                   30.3923047727357   (obj:0)
x6                                                 14   (obj:0)
x7                                   18.3923048064677   (obj:0)
x8                                                  8   (obj:0)
x9                                                  8   (obj:0)
x10                                                 2   (obj:0)
x11                                  19.6154311552252   (obj:0)

[18,3,1] ↦ 1295.999999999

SCIP Status        : problem is solved [optimal solution found]
Solving Time (sec) : 0.00
Solving Nodes      : 13
Primal Bound       : +1.29599999999900e+03 (4 solutions)
Dual Bound         : +1.29599999999900e+03
Gap                : 0.00 %
objective value:                       1295.999999999
x1                                   35.9999999999722   (obj:0)
x2                                                 36   (obj:0)
x3                                     1295.999999999   (obj:1)
x4                                   17.9999999999722   (obj:0)
x5                                                 18   (obj:0)
x6                                   32.8552571627738   (obj:0)
x7                                                  3   (obj:0)
x8                                                  1   (obj:0)
x9                                                  1   (obj:0)

Bonus cases

[1,2,3,4,5] ↦ 230.244214912998

SCIP Status        : problem is solved [optimal solution found]
Solving Time (sec) : 401.31
Solving Nodes      : 1400341
Primal Bound       : +2.30244214912998e+02 (16 solutions)
Dual Bound         : +2.30244214912998e+02
Gap                : 0.00 %
objective value:                     230.244214912998
x1                                   13.9282031800476   (obj:0)
x2                                    16.530790960676   (obj:0)
x3                                   230.244214912998   (obj:1)
x4                                                  1   (obj:0)
x5                                   9.60188492354373   (obj:0)
x6                                    11.757778088743   (obj:0)
x7                                   3.17450418828415   (obj:0)
x8                                                  3   (obj:0)
x9                                    13.530790960676   (obj:0)
x10                                  9.92820318004764   (obj:0)
x11                                   12.530790960676   (obj:0)
x12                                                 5   (obj:0)
x13                                                 5   (obj:0)

[3,4,5,6,7] ↦ 553.918025310597

SCIP Status        : problem is solved [optimal solution found]
Solving Time (sec) : 90.28
Solving Nodes      : 248281
Primal Bound       : +5.53918025310597e+02 (18 solutions)
Dual Bound         : +5.53918025310597e+02
Gap                : 0.00 %
objective value:                     553.918025310597
x1                                   21.9544511351279   (obj:0)
x2                                   25.2303290086403   (obj:0)
x3                                   553.918025310597   (obj:1)
x4                                                  3   (obj:0)
x5                                   14.4852813557912   (obj:0)
x6                                   4.87198593295855   (obj:0)
x7                                   21.2303290086403   (obj:0)
x8                                   16.9544511351279   (obj:0)
x9                                                  5   (obj:0)
x10                                                 6   (obj:0)
x11                                                 6   (obj:0)
x12                                  14.9544511351279   (obj:0)
x13                                  16.8321595389753   (obj:0)

[3,4,5,6,7,8] ↦ 777.87455544487

SCIP Status        : problem is solved [optimal solution found]
Solving Time (sec) : 218.29
Solving Nodes      : 551316
Primal Bound       : +7.77874555444870e+02 (29 solutions)
Dual Bound         : +7.77874555444870e+02
Gap                : 0.00 %
objective value:                      777.87455544487
x1                                   29.9626413867546   (obj:0)
x2                                   25.9614813640722   (obj:0)
x3                                    777.87455544487   (obj:1)
x4                                   13.7325948669477   (obj:0)
x5                                   15.3563780595534   (obj:0)
x6                                   16.0504838821134   (obj:0)
x7                                   21.9614813640722   (obj:0)
x8                                   24.9626413867546   (obj:0)
x9                                   20.7071098175984   (obj:0)
x10                                                 6   (obj:0)
x11                                  19.9614813640722   (obj:0)
x12                                                 7   (obj:0)
x13                                                 7   (obj:0)
x14                                  21.9626413867546   (obj:0)
x15                                  8.05799919177801   (obj:0)


'Add' up the letters in a word My dad is a retired teacher, and he used to give combined spelling and math quizzes, where the student would spell a word, and then 'score' the word by adding up the letters, where a=1, b=2, etc. (e.g. cat = 3+1+20=24).  This made grading the quizzes easier, as he would just have to check for incorrect 'scores' rather than incorrectly spelled words, and had the added benefit of testing 2 skills at once.

He hired a friend of mine to write a program that would score words for him, so he could generate lengthy answer keys without error.  This problem is inspired by that program.

Requirements:

Accept any word with uppercase and lowercase letters
Return an error for any special characters, i.e. spaces, hyphens, @^%# etc.
a=1, b=2,... and A=1, B=2,...
Print the score of the word
(Optional) check that the word is in a dictionary after scoring, and print a warning if it is not.
No importing an external letter->number dictionary.  You must generate it yourself.

Any language is acceptable. This is similar to the 'digital root battle,' but much simpler.

Ruby, 43 characters

$_=gets.upcase;p~/[^A-Z]/?_: $_.sum-64*~/$/

The error message this generates isn't exactly helpful, though.
Both solutions posted here assume the input has no trailing linebreak, so to test them, use echo -n.

Ruby, 76 characters with dictionary check

l=STDIN.gets;$_=l.upcase;p~/[^A-Z]/?_: $_.sum-64*~/$/;[*$<].index(l)||$><<?W

The warning message consists of the single character "W". The path to the dictionary has to be supplied via ARGV. Example usage:

$ echo -n asd | ruby addletters.rb /usr/share/dict/words
24
W
$ echo -n cat | ruby addletters.rb /usr/share/dict/words
24


Let's decrease the monotony ...but hey, no need to be strict.
Given a non-empty array of strictly positive integers, determine if it is:

Monotone strictly decreasing. This means that each entry is strictly less than the previous one.
Monotone non-increasing, but not strictly decreasing. This means that each entry is less than or equal to the preceding, and the array does not fall in the above category.
None of the above.

Note the following corner cases:

An array with a single number is monotone strictly decreasing (vacuously so).
An array with the same number repeated is monotone non-increasing, but not strictly decreasing.

Rules
You may provide a program or a function
Input can be taken in any reasonable format: array, list, string with numbers separated by spaces, ...
You can choose any three consistent outputs for the three categories respectively. For example, outputs can be numbers 0, 1, 2; or strings 1 1, 1 0, empty string.
Shortest code in bytes wins
Test cases
Monotone strictly decreasing:
7 5 4 3 1
42 41
5

Monotone non-increasing, but not strictly decreasing:
27 19 19 10 3
6 4 2 2 2
9 9 9 9

None of the above:
1 2 3 2
10 9 8 7 12
4 6 4 4 2

Perl 6, 17 bytes

{[>](@_)+[>=] @_}

Monotone strictly decreasing: 2
Monotone non-increasing: 1
Other: 0

Expanded:

{            # bare block lambda with implicit parameter list ｢@_｣
  [>]( @_ )  # reduce using ｢&infix:« > »｣
  +
  [>=] @_    # reduce using ｢&infix:« >= »｣
}