text:
Universal Spooky Meme Translator
Introduction
Turns out, aliens love memes just as much as we do. Every alien race we've encountered so far has their own version of 2spooky4me (see the following question) and equivalent, though, with some variation. The inhabitants of planet CUTE1f can't handle a lot of spook, so their preferred spook is 1spooky2me, while skeletor7 memers love them some spook, so they tend to use 9spooky11me.
Challenge
Translating memes is hard work, so you've been tasked with writing a universal meme translator to help these guys access the memenet correctly. Your program will accept a meme and a transformation to apply to the digit sequences in that meme to make it appropriate for the inhabitants of a different planet.
Input
Your program will receive two string inputs:

The input meme (e.g. 2spooky4me). Matches [a-zA-Z0-9]+.
The transformation to apply to it (e.g. +1, to go from 2spooky4me to 3spooky5me). Matches [+\-*/^]\d+ (you must accept +, -, *, /, and ^ as operators, regardless of the native representation in your language).

Output
Your program must return a string output (printed to standard output or equivalent) with the given transformation applied to the digit sequences in the input meme. In a weird turn of events, it also turns out that all races encountered so far prefer integral memes over fractional ones, so these transformations should perform integer arithmetic (e.g. 1spooky1me /2 should result in 0spooky0me).
Examples
Standard arithmetic operations apply:
Input:  2spooky4me +1
Output: 3spooky5me

Input:  2spooky4me -1
Output: 1spooky3me

Input:  2spooky4me *15
Output: 30spooky60me

Input:  10spooky900me /5
Output: 2spooky180me

Digit sequences are integral; integer truncation should occur in cases like this:
Input:  idontunderstandmemes3 /2
Output: idontunderstandmemes1

Your input may not have any digit sequences:
Input:  notreallyafunnymeme *100
Output: notreallyafunnymeme

You must support exponentiation, even if it is not a native operation in your language of choice:
Input:  2spooky4me ^3
Output: 8spooky64me

There's no limit on string length of number of digit sequences in the string:
Input:  some1meme2sequences3can4be5really6long7 /2
Output: some0meme1sequences1can2be2really3long3

Addendum
If your language supports arbitrary-precision integers as a language feature, you must use those. If it does not, you do not need to support arbitrary-precision integers. For example, you must use Integer in Haskell instead of Int because it's available as part of the language; in Java, you are not required to use BigInteger because it's a library feature, not a language feature.
Input:  2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000spooky4me /2
Output: 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000spooky2me

This is code-golf, so standard loopholes are forbidden, and the shortest answer in bytes wins!
Leaderboard
The Stack Snippet at the bottom of this post generates the leaderboard from the answers a) as a list of shortest solution per language and b) as an overall leaderboard.
To make sure that your answer shows up, please start your answer with a headline, using the following Markdown template:
## Language Name, N bytes

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

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

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

 <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">

Shortest Solution by Language

Language	User	Score

Leaderboard

	Author	Language	Size

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

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

Your last test case is wrong. You have one too many zeros in the output for it to be /5.

Welcome to PPCG! As [tag:arithmetic] refers solely to Elementary Arithmetic, I suggest you retag this question to [tag:math], which would be more appropriate for a challenge that requires exponents.

First of all this is a reasonably well put together first post, so congrats :)  Note we have a Sandbox where you can post your challenge for feedback before it goes live.

Welcome to PPCG (even though you've apparently been here for 2+ years). Nice first challenge. Does the addendum about arbitrary precision integers mandate that, for example, Java must use BigInteger for its calculations?

@GeorgeGibson Ah, thank you! I wasn't sure about how to tag it, but thank you for letting me know.

@FryAmTheEggman Thanks! I'll definitely go through the sandbox next time. :)

@TimmyD Clarified in the post — if it's a language feature, then yes. If it's just available as part of the standard library, then no. e.g. yes in Haskell, no in Java

The exponential one is evil.

@Bálint Why, thank you.

Do we have to use the symbols +, -, *, / and ^ or can we use the symbols our language uses natively?

Every alien race we've encountered so far... That's totally true! :-)

@Dennis You must use the symbols +, -, *, /, and ^... Sorry not sorry.

It's your challenge and ultimately up to you, but that's not really fair towards languages that happen to use a different syntax.

@Dennis True. However, that would then tie specific inputs to specific languages, which I think goes against the spirit of the question, no? Is this a common thing among other code golf questions?

@Dennis If it is common to make exceptions for languages in this way, then I will amend my question. I think you would know way better than I do.

Yes, this is common.

@Dennis I think the challenge is fine as-is. It's an explicit translation request, so it should fall under the "specific format" exception.

BTW, I'd expected something like "and because some aliens are scared from long code, you need to write it as short as possible"

@Dennis As a compromise, would it be appropriate to award bonus bytes if your language does not support those arithmetic operators by default but you implement them anyway? (Allowing you to stick to the defaults if necessary.)

Bonuses in code-golf are generally not a good idea. At this point, I wouldn't change the challenge anymore.

If you insist on BigInt functionality, you should include a test case that requires them. My previous revision of the Julia submission was failing 2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000spooky4me, /2. Fixing that cost 17 bytes... :(

@Dennis Yikes, sorry! :( Added an example above.

I might be overlooking it in the spec but do we need to handle inputs like 2spooky4me -5?

What's the answer to 2spooky4me, /0?

9spooky11me is of a slightly bad taste, and it's not spooky at all (it's just macabre/tragic/sad/reminding)... maybe you can choose 6spooky66me instead? Satanism is not prohibited, as far as I know :)

@carusocomputing That's undefined, as the operation doesn't really make sense.

@ItaiFerber As in your code can error or cannot error on it?

@carusocomputing Your code is allowed to error on it; it's not really a valid input.

Jolf, 15 14 bytes
ρi«\d+»dC!6+HI

Try it here!
Explanation
ρi«\d+»dC!6+HI
ρ «\d+»         replace all digits
 i              in the input
       d        (functional replace)
         !6     eval (using jolf's custom infix eval)
           +H   the number as a string plus
             I  the second input
        C       floor the result (integer truncate)

Fun to note, I updated Jolf after this challenge, adding some RegExp builtins. This could be 12 11 bytes:
ρiLRdC!6+HI

Ruby, 50 44 43 bytes
FGITW answer. Gotta go fast!
Thanks to @Neil for saving 6 bytes.
Oh right, crossed out 44 is still 44
->m,t{m.gsub(/\d+/){eval$&+t.sub(?^,'**')}}

Oh, man, this is almost exactly an answer I was poking away at: a=gets;$><<gets.gsub(/\d+/){eval$&+a}. Mine missed the ^ != ** thing, though, and is probably a bit longer.

+1 for having your whole solution be 4 bytes shorter than what's needed in PowerShell just to handle ^. :D

Perl, 36 34 bytes
s/\d+/"0|$&$^I"=~s#\^#**#r/gee

The source code is 30 bytes long and it requires the switches -pi (+4 bytes). It takes the first input from STDIN, the second input as an argument to -i.
Thanks to @DenisIbaev for golfing off 2 bytes!
Test it on Ideone.

Yep, I figured if anybody could beat my Ruby answer, it would be Dennis and/or be in Perl, and you ended up fulfilling both expectations at the same time

-pi is 4 bytes?

@CatsAreFluffy Current consensus is to count the edit distance from the invocation without the flags. That includes a space to separate -pi from the rest of the command.

"0|$&" is shorter than "0|".$&.

@DenisIbaev Since the input is alphanumeric, "0|$&$^I" works too. Thanks!

PowerShell v2+, 139 137 bytes
param($a,$b)-join($a-split"(\d+)"|%{if($_-match"\d+"){if($b[0]-ne'^'){[math]::Floor((iex $_$b))}else{"$_*"*$b.Trim('^')+1|iex}}else{$_}})

Ooof ... 47 bytes just to account for ^ since that's not a native operator in PowerShell. Saved 2 bytes thanks to @TessellatingHeckler.
Takes input as $a=<word>, $b=<operation>, like .\universal-spooky-meme.ps1 2spooky4me ^3. We -split $a on digits, enclosing that in parens so we keep the delimiters, and pipe the resultant array through a loop |%{...}. If the current piece is a number, we're in the first if. We need to check whether the first character of $b is ^. If it's not, we simply concatenate our current piece and $b and send it to iex (similar to eval), then leave that on the pipeline. Otherwise, we need to create an exponentiation string with "$_*"*$b.Trim('^')+1 and pipe that to iex, and leave that on the pipeline. For the given 2spooky4me ^3 example, this will be 2*2*2*1 and 4*4*4*1, respectively.
Otherwise, we just leave the string as-is on the pipeline.
All of those results are gathered from the pipeline with the encapsulating parens before being -joined back together into one string. That is the re-left on the pipeline, and output is implicit at program termination.
Examples
PS C:\Tools\Scripts\golfing> .\universal-spooky-meme.ps1 2spooky4me ^5
32spooky1024me

PS C:\Tools\Scripts\golfing> .\universal-spooky-meme.ps1 2spooky4me /3
0spooky1me

I wrote my own before looking at answers, then I pinched some of your ideas as well - thanks. I think you could replace Floor(("$_$b"|iex)) with Floor((iex $_$b)) to save a couple, or maybe iex $_+$b.

@TessellatingHeckler Thanks for the two bytes!

JavaScript (ES7), 58 57 bytes
(s,t)=>s.replace(/\d+/g,n=>0|eval(n+t.replace('^','**')))

Edit: Saved 1 byte when I remembered that replace also works on literal strings.

Cool, I'm working on an ES6 solution

Can you curry to save a byte?

@gcampbell Yes, but I'm too lazy to.

Python 2, 156 89 88 87 bytes
Inspired by the other answers that use their languages' substitution function with a function handler to process the numeric parts of the long input string with the operator. Unlucky for Python, the ^ must be replaced by **, which costs a whopping 18 bytes. The .group(0) call just to access the match object's string representation does not make things better...
Thanks to QPaysTaxes for spotting a spurious space and RootTwo for the unnecessary argument to .group!
import re
lambda i,o:re.sub(r'\d+',lambda p:str(eval(p.group()+o.replace('^','**'))),i)

I think you can get rid of the space after i,o:

You can save two more bytes: (1) by using p.group().  (it defaults to 0); and (2) insert r=re.sub; replace first re.sub call with r and then use r('^','**',o) instead of o.replace(...)

@RootTwo: For me, the  r('^','**',o) then requires escaping ^ to \^ in order to match the character, not the beginning of o, net saving no bytes :-(  - but thanks for pointing out the unnecessary 0!

Pyth, 29
Jws.i:zK"\d+"3m.vs.iJ]+d;:zK1

This works by extracting each number from the meme, and then interleaving (.i) it followed by a space and wrapped in a list with the other argument. So if our number is 7 and we had ^20 we would get the list: ["^", "7 ", "20"]. Flattening and using Pyth's eval (.v) on this always gives the operation we want. Finally these values are interleaved with the original string split on occurrences of numbers.
This could be a byte shorter if both inputs were surrounded by quote characters, or two bytes shorter if only one of them could be quoted.
Try it here or run a Test Suite

Javascript (ES6) 99 bytes
Another example, why we hate to wait for ES7 to get compatibility
(a,b)=>a.match(/\d+|\D+/g).map(_=>(d=- -_)?eval(b[0]=="\^"?Math.pow(_,b.slice(1)):d+b)|0:_).join``

Runnable example:

f=(a,b)=>a.match(/\d+|\D+/g).map(_=>(d=- -_)?Math.ceil(eval(b[0]=="\^"?Math.pow(_,b.slice(1)):d+b)):_).join``

alert(f(prompt("Enter string!"), prompt("Enter operation!")));

Your matching regexes seem to be a bit off. In the runnable example, you leave out uppercase letters, which strips them out of the result ("2spooky4ME", "+1" => "3spooky5"), and in the first example, you match against \d+|\D+, which is equivalent to .+. [a-zA-Z0-9]+ is the regex you want, no? Or [a-zA-Z]+|[0-9]+ if the splitting makes a difference?

It would probably be easier to invoke Math.pow directly as you're having to special-case it anyway. Also, are you using integer division?

@Neil I forgot that, minute

@Neil is there a better way for ceiling?

Not sure why you want ceiling but |0 might help.

@Neil I thought you need ceiling

@ItaiFerber I'm not sure why that would be better, and I tested, and it's correct. Please learn about regexes

@ItaiFerber \d+|\D+ Isn't quite the same as .+. They aren't the same because the kleene expansion happens before the or. It would be the same if it looked like (\d|\D)+, but as is, it wouldn't match all of say 2a in one group, it would be two separate groups.

@FryAmTheEggman Right, duh. Again, too hasty an evaluation here. Thanks!

@Bálint Sorry about that

You can curry to save a byte

Julia, 71 59 54 bytes
/ =÷
x%y=replace(x,r"\d+",t->"big($t)"y|>parse|>eval)

The requirement to use big if available makes this a lot longer than it could be...
Try it online!

PowerShell (v4), 124 120 bytes
# New 120 byte version:
$s,$a=$args;[regex]::Replace($s,'\d+',{($(if($a-ne($a=$a.Trim('^'))){
"$args*"*$a+1}else{"$args$a"})|iex)-replace'\..*'})

# Previous 124 byte version
$s,$a=$args;[regex]::Replace($s,'\d+',{if($a[0]-eq'^'){
[math]::pow("$args",$a.Trim('^'))}else{iex "$args$a-replace'\..*'"}})

(the newlines are only here to avoid horizontal scrolling, they work when saved as one line).
Comments, and ungolfed version was requested:
$meme, $instruction = $args

# Scriptblock which processes the numbers
# to be replaced. $args is the input number.
$replacement = {

    # Generates a string of the calculation, by:
    # Removing leading ^ character, if present.
    # ^3 -> 3,      +3 -> +3
    # See if it was present, and switch code paths.
    # (Can be one combined step in the golf)
    # Switch code paths for "raise to the power of",
    # or basic arithmetic.
    $trimmedInstruction = $instruction.Trim('^')
    $tmp = if ( $instruction -ne $trimmedInstruction ) {

        # String multiplication, changes
        # function input "45" and instruction "3" into
        # "45*45*45*+1". The "3" implicitly casts to [int]
        # the +1 is there to make the trailing * not crash.
        "$args*" * $instruction + 1

    } else {
        # Cobble the basic math together as a string
        # "45" and "+10" becomes
        # "45+10"
        "$args$instruction"
    }

    # eval() the generated string (e.g. "45+10" or "45*45*45*+1")
    $tmp = Invoke-Expression $tmp      # iex

    # Use a regex golf to replace trailing .23423
    # decimals in case of division with remainder.
    # Acts as [math]::floor(), harmless on other numbers.
    $tmp -replace'\..*'
}

# A regular expression replacement which picks out all
# the numbers (\d+) and runs them through the
# replacement function. Returns a string which
# ends up on stdout
[regex]::Replace($meme, '\d+', $replacement)

.Net regex library can do a replace with a scriptblock that executes on the content of the match, and PowerShell casts types strings to numbers, and iex is like eval() in other languages. It just does "2spooky" "+3" -> eval("2+3")
Except... it can't handle ^ operator or any other convenient exponentiation like **, it can only use the [math]::Pow() library call so there's a big block to handle that branch.

The updated version steals an idea from @TimmyD and does string multiplication instead - "2*" * n which becomes "2*2*2*2*" and then adds +1 on the end to multiply by one instead of complaining about the trailing *.

Except... .Net does Banker's Rounding which rounds to the nearest even number by default, and 3/2 = 2 rather than 3/2 = 1. This challenge calls for truncation, and that means [math]::Truncate(). Instead, I save characters by using -replace to trim a decimal point and anything after it.

Test cases:
PS D:\> .\meme.ps1 2spooky4me +1
3spooky5me

PS D:\> .\meme.ps1 2spooky4me -1
1spooky3me

PS D:\> .\meme.ps1 2spooky4me *15
30spooky60me

PS D:\> .\meme.ps1 10spooky900me /5
2spooky180me

PS D:\> .\meme.ps1 idontunderstandememes3 /2
idontunderstandememes1

PS D:\> .\meme.ps1 "idontunderstandememes3" "/2"
idontunderstandememes1

PS D:\> .\meme.ps1 "notreallyafunnymeme" "*100"
notreallyafunnymeme

PS D:\> .\meme.ps1 "2spooky4me" "^3"
8spooky64me

PS D:\> .\meme.ps1 "some1meme2sequences3can4be5really6long7" "/2"
some0meme1sequences1can2be2really3long3

PS D:\> .\meme.ps1 2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000spooky4me /2
1E+780spooky2me

NB. In the last test the numbers overflow into type [BigInteger] automatically, but they get rendered in scientific notation. Luckily, every known race able to communicate between the stars has enough scientific development to be able to process scientific notation without problem.

You can see in other answers how they provide a rather unreadable golfed version and then a separate ungolfed version for examining the code behavior. You should do this with yours (namely, remove the newlines in the golfed version).

Thanks for the credit, but not my trick -- I pulled it from the PowerShell Tips thread.

Apparently, I care enough to leave a comment, and someone else cares enough to upvote my comment. ;)

No, I said you should have a fully golfed version and a fully ungolfed version. The golfed one will require scrolling. The ungolfed one will not and will be more readable than the one you have.

@jpmc26 Ok, I've edited in an ungolfed, commented version.

Kotlin, 416 413 Bytes
The lack of an eval() in Kotlin really upped that byte count...
fun main(a:Array<String>){var r=Regex("\\d+");var i=a[0];var n=a[1].takeLast(a[1].length-1).toInt();when(a[1][0]){'+'->print(r.replace(i,{m->""+(m.value.toInt()+n)}));'*'->print(r.replace(i,{m->""+(m.value.toInt()*n)}));'/'->print(r.replace(i,{m->""+(m.value.toInt()/n)}));'-'->print(r.replace(i,{m->""+(m.value.toInt()-n)}));'^'->print(r.replace(i,{m->""+(Math.pow(m.value.toDouble(),n.toDouble())).toInt()}));}}

Try it Online!
Ungolfed
fun main(a: Array<String>) {
    var r = Regex("""\d+""")
    var i = a[0]
    var n = a[1].takeLast(a[1].length - 1).toInt()
    when (a[1][0]) {
        '+' -> print(r.replace(i, { m -> "" + (m.value.toInt() + n) }))
        '*' -> print(r.replace(i, { m -> "" + (m.value.toInt() * n) }))
        '/' -> print(r.replace(i, { m -> "" + (m.value.toInt() / n) }))
        '-' -> print(r.replace(i, { m -> "" + (m.value.toInt() - n) }))
        '^' -> print(r.replace(i, { m -> "" + (Math.pow(m.value.toDouble(), n.toDouble())).toInt() }))
    }
}

Lua, 145 93 bytes
r=io.read;m=r()o=r()m=m:gsub("%d",function(n)return loadstring("return..."..o)(n)end)print(m)

Why not just post a function?

Bash + GNU coreutils, 144 Bytes
d=
u=$1,
for((i=0;i<${#u};i++)){ l=${u:i:1}
[[ "$l" =~ [0-9] ]]&&d=$d$l||{ [ -z $d ]||echo -n `bc<<<$d$2`&&{ [ $l != , ]&&echo -n $l; };d=; }
}

This looks at the alteration between digits and non-digits, that's why a random invalid input character (comma) is appended to the input string. This comma is then ignored in the output. The convention of the OP follows exactly the syntax of bc which is used here to do the maths.

By the way because of discussion in the PowerShell-solution by @TessellatingHeckler: In my solution, you can translate the program to a single line by replacing the line breaks to semicolons, which does not change its length.

Zsh (builtins only), 167 118 bytes
a=$1 S=(${(s: :)a//[0-9]/ })
for i (${(s: :)a//[a-z]/ })N+=($[i${2/^/**}])
((#a<58))&&<<<${(j::)N:^S}||<<<${(j::)S:^N}

Crack the input into a numerical array N and string array S, do operations on N, then zip the arrays together again (zip the arrays the other way if the leading character is a letter).
Try it Online.
167 bytes! (longer than the bash solution! ☹ )

95 bytes

GammaFunction for the win!

Zsh, 95 bytes
Whole program. Inputs: the meme and transformation as command line arguments. Output: standard output (with a trailing newline).
a=$1;repeat $#a c=${a/[^0-9]*}&&(($#c))&&b+=$[$c${2/^/**}] a=${a##<->}||b+=$a[1] a=${a#?};<<<$b

Try it online!
A 98-byte solution with a non-optimized number/letter test:
a=$1;repeat $#a [[ $a = <->* ]]&&b+=$[${a%%[^0-9]*}${2/^/**}] a=${a##<->}||b+=$a[1] a=${a#?};<<<$b

Explanation: first here's the code with additional whitespace.
a=$1;
repeat $#a \
  c=${a/[^0-9]*} &&
  (($#c)) &&
  b+=$[$c${2/^/**}] a=${a##<->} ||
  b+=$a[1] a=${a#?};
<<<$b

The general idea is to consume the input in $a from left to right, one multi-digit integer or one non-digit character at a time. Accumulate the result in $b, which is printed out after the loop.
repeat $#a … repeats the following code $#a (initial length of the input) times. The loop body consumes at least one character as long as $a is non-empty and does nothing when it runs out, so this works, and it's shorter than naive approaches such as while (($#a)) or while [ $a ]. In the loop body:

Set c to the initial digit sequence of $a (remove everything starting with the first non-digit). ${a/[^0-9]*} is short for ${a/[^0-9]*/} and shorter than the more intuitive ${a%%[^0-9]*}. The assignment always succeeds, so the subsequent && is just like ; except that it doesn't terminate the repeat body.
((#c)) tests whether c is non-empty, i.e. if $a starts with a digit.
If the test above, i.e. if $a starts with a digit, append the result of the arithmetic expression $[…] (an alternative form of $((…))) to b. The expression uses the digits in $c and the operator-and-number from $2. Zsh has the operators + - * / as required but exponentiation is ** instead of ^.
If the test above was false, i.e. if $a starts with a non-digit, append the first character of $a to b and remove the first character from a.

Zsh --extendedglob, 39 bytes
<<<${1//(#m)[0-9]##/$[MATCH${2/\^/**}]}

Try it online!

This is the way. An elegant solution :)

R, 163 bytes
As someone who's learning regular expressions and string substitution in R, this proved to be a quite difficult challenge. Especially because matching the numbers is easy but I couldn't find a way to use multiple substitutions with gsub. Furthermore, I don't know if eval(parse(paste0(... is the most efficient way to switch between operations. Maybe the switch-function is better suited here.
function(s,o){p=strsplit;y=p(gsub("\\d+","?",s),"?")[[1]];x=na.omit(as.integer(p(s,"[a-zA-Z]+")[[1]]));y[y=="?"]=floor(eval(parse(,,paste0("x",o))));cat(y,sep="")}

Explanation
f=function(s,o){
    p=strsplit                                    # alias for stringsplit
    y=p(gsub("\\d+","?",s),"?")[[1]]              # substitute numbers with "?" and split into vector on "?"
    x=na.omit(as.integer(p(s,"[a-zA-Z]+")[[1]]))  # split at alphabetical char, return vector with numbers to be operated on
    y[y=="?"]=floor(eval(parse(,,paste0("x",o)))) # replace inserted "?" with vector of numbers operated on
    cat(y,sep="")                                 # print concatenated vector
}

I think you can save a ton of bytes if you use gsub with a closure on the matches, which is what you hinted at in your comment. I don't know how to do it in R though. I struggled with that too until I found out how to do that in Groovy; was pretty much a game changer.

Javascript (ES6), 85 Bytes
x=(s)=>{var a=s.split(" ");return[...a[0]].map(x=>(!isNaN(x))?eval(x+a[1]):x).join``}

console.log(x("2spookie5me +1"));

Ungolfed:
x = (s) => {
  var a = s.split(" ");
  return [...a[0]].map(x => (!isNaN(x)) ? eval(x + a[1]) : x).join ``
}
console.log(x("2spookie5me +1"));

Anyone know if i can split spaces using Spread operator?
From this s.split(" ");
to [" "...s];
At least thats the idea.

You don't need () around the lambda argument, you don't need var, and you should use parens and the comma operator instead of braces and return

Also, ^ is a special case to JavaScript, it is a bitwise XOR instead of Math.pow

Groovy, 64 60 Bytes
{a,b->a.replaceAll(/\d+/,{Eval.me(it+b.replace("^","**"))})}

Replaces all instances of digits with a closure that evaluates the operation on the digit portions of the word passed. If passed an exponent function, it replaces it with the proper notation. Groovy implicitly handles BigInteger/BigDecimal conversion when using Eval.me() because parsed strings can potentially be out of the 2^32-1 range.
Explained
{a,b->...} - Closure with two arguments.
a.replaceAll(/\d+/,{...}) - Search for all digit sequences in string and replace with a closure.
{Eval.me(it+b.replace("^","**"))} - More specifically, a closure with each match having the operation appended to it, then evaluated as groovy code.
.replace("^","**") - Replace the first instance of ^ with the groovy exponent operator ** in the operation provided. If you want this to work with full equation strings that use exponents, use replaceAll() instead for a +3 byte penalty.
Fun side-note his is a valid test scenario:
(22348952345238905290858906209862398036spooky409552me, /200*4943^8-23939+((100/203)+600)

05AB1E, 18 bytes
ε.γd]``s„^/„m÷‡.VJ

Input as a pair of strings.
Try it online or verify all test cases.
Explanation:
ε                  # Map both strings in the (implicit) input-pair to:
 .γ                #  Group it into substrings by:
   d               #   Is it a non-negative number
    ]              # Close both the map and inner group-by
     `             # Pop and push both list or substrings separated to the stack
      `            # Pop and push the operator and number separated to the stack
       s           # Swap them, so the operator is at the top of the stack
        „^/„m÷‡    # Transliterate "^" to "m" and "/" to "÷"
               .V  # Evaluate the operator string as 05AB1E command
                   # (the operations are no-ops on the non-number substrings)
                 J # Join the list of substrings back together to a single string
                   # (after which it is output implicitly as result)

If the final test case wasn't necessary, it could have been 17 bytes (which unfortunately has floating-point precision issues for the final test case):
ε.γd]``s'^'m:.VïJ

Try it online or verify all test cases.
Explanation:
Mostly the same as above, except for „^/„m÷‡ being '^'m: to only transform the exponent-operator and leave the division-operator as is, and the addition of ï to truncate the decimals after the eval.

05AB1E code is pretty spooky stuff all right!

RProgN, 39 Bytes
►x='%d+'§x'%D+'''Rx'%d+'''Rg'y'=y_}R

Explained
►x='%d+'§x'%D+'''Rx'%d+'''Rg'y'=y_}R
►                                       # Spaceless segment.
 x=                                     # Assign the top value of the stack '[+*/-]\d+'
   '$d+'§                         }R     # Replace everything in the pattern %d+ (all numbers) based on an anonymous function
         x'%D+'''R                      # Replace all Non-digits in the modifer with nothing, leaving just the second argument for the operator.
                  x'%d+'''R             # Snip all digits, separating our operator from our digits such that digit operator exists in the stack.
                           g'y'=        # Grab the function that is represented by the top of the stack (the operator in this case)
                                y       # Run it
                                 _      # Floor the result.

Technically invalid answer, because this language did not exist for it. However, it was not specifically designed for it, nor any particular addition. So I'm running it. Sue me.
Try it Online!

Perl 6, 111 bytes
{/(\w+)\s(<[+\-*/^]>)(\d+)/&&my \b=+$2;my \o=(*+b,*-b,* *b,*div b,* **b)[index "+-*/^",$1];$0.subst(/\d+/,o):g}

Unfortunately EVAL is disabled by default. Also, you have to use div for integer division.


text:
Columnar Transposition Cipher
Columnar Transposition Cipher
While I have plenty of programs I have written for more advanced ciphers, I just realised I don't actually have one for one of the simplest: Columnar Transposition. The cipher, in case you don't know, works as follows:

First, you take the key, and write it as numbers. The numbers are made by replacing the letter which comes first in the alphabet with 1, the letter that comes next 2 and so on, ignoring duplicates (the key GOAT would become 2314). These numbers are the headers of the columns.
2314
----

Next, you write your message under the columns.
2314
----
Hell
o Wo
rld!

Finally, rearrange the columns into the numerical order in which they would fall, and read the ciphertext across.
1234
----
lHel
Wo o
drl!

Which will result in your encoded text: lHelWo odrl!

Rules

Each submission should be either a full program or function. If it is a function, it must be runnable by only needing to add the function call to the bottom of the program. Anything else (e.g. headers in C), must be included.
There must be a free interpreter/compiler available for your language.
If it is possible, provide a link to a site where your program can be tested.
Your program must not write anything to STDERR.
Your program should take input as an argument or from STDIN (or the closest alternative in your language).
Standard loopholes are forbidden.

Requirements

Case must be preserved.
Your cipher should be 'irregular', that is, if there are any spaces left after you have written out your message, it is treated as if it were a normal space character.
Only encryption is required, decryption may come in a later challenge.
Input should be taken from STDIN with the key on the first line, and the plaintext on the second. If you are taking input as an argument, please specify how this is done for your language.
The key can be in any case.
Duplicates in the key should be ignored - that is, ABCDB would become ABCD. Duplicates also apply in any case.
Trailing whitespace is included.

Test Cases
CBABD, Duplicates are ignored. ==> puDlacit sea eriongr.de
bDaEc, Key can be in multicase! ==> yKce  aenbn mi tucliea s!

Full example, with 'surplus space' rule.
ADCB
----
"Goo
d Mo
rnin
g!"
he c
alle
d.

ABCD
----
"ooG
dom
rnin
g "!
hc e
aell
d  .

Message: "ooGdom rning "!hc eaelld  .

Scoring
code-golf is how we score this challenge!
Submissions
To make sure that your answer shows up, please start your answer with a headline, using the following Markdown template:
# Language Name, N bytes

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

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

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

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

/* Configuration */

var QUESTION_ID = 79810; // Obtain this from the url
// It will be like https://XYZ.stackexchange.com/questions/QUESTION_ID/... on any question page
var ANSWER_FILTER = "!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe";
var COMMENT_FILTER = "!)Q2B_A2kjfAiU78X(md6BoYk";
var OVERRIDE_USER = 53406; // This should be the user ID of the challenge author.

/* App */

var answers = [], answers_hash, answer_ids, answer_page = 1, more_answers = true, comment_page;

function answersUrl(index) {
  return "https://api.stackexchange.com/2.2/questions/" +  QUESTION_ID + "/answers?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + ANSWER_FILTER;
}

function commentUrl(index, answers) {
  return "https://api.stackexchange.com/2.2/answers/" + answers.join(';') + "/comments?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + COMMENT_FILTER;
}

function getAnswers() {
  jQuery.ajax({
    url: answersUrl(answer_page++),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function (data) {
      answers.push.apply(answers, data.items);
      answers_hash = [];
      answer_ids = [];
      data.items.forEach(function(a) {
        a.comments = [];
        var id = +a.share_link.match(/\d+/);
        answer_ids.push(id);
        answers_hash[id] = a;
      });
      if (!data.has_more) more_answers = false;
      comment_page = 1;
      getComments();
    }
  });
}

function getComments() {
  jQuery.ajax({
    url: commentUrl(comment_page++, answer_ids),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function (data) {
      data.items.forEach(function(c) {
        if (c.owner.user_id === OVERRIDE_USER)
          answers_hash[c.post_id].comments.push(c);
      });
      if (data.has_more) getComments();
      else if (more_answers) getAnswers();
      else process();
    }
  });
}

getAnswers();

var SCORE_REG = /<h\d>\s*([^\n,]*[^\s,]),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/;

var OVERRIDE_REG = /^Override\s*header:\s*/i;

function getAuthorName(a) {
  return a.owner.display_name;
}

function process() {
  var valid = [];

  answers.forEach(function(a) {
    var body = a.body;
    a.comments.forEach(function(c) {
      if(OVERRIDE_REG.test(c.body))
        body = '
' + c.body.replace(OVERRIDE_REG, '') + '
';
    });

    var match = body.match(SCORE_REG);
    if (match)
      valid.push({
        user: getAuthorName(a),
        size: +match[2],
        language: match[1],
        link: a.share_link,
      });

  });

  valid.sort(function (a, b) {
    var aB = a.size,
        bB = b.size;
    return aB - bB
  });

  var languages = {};
  var place = 1;
  var lastSize = null;
  var lastPlace = 1;
  valid.forEach(function (a) {
    if (a.size != lastSize)
      lastPlace = place;
    lastSize = a.size;
    ++place;

    var answer = jQuery("#answer-template").html();
    answer = answer.replace("{{PLACE}}", lastPlace + ".")
                   .replace("{{NAME}}", a.user)
                   .replace("{{LANGUAGE}}", a.language)
                   .replace("{{SIZE}}", a.size)
                   .replace("{{LINK}}", a.link);
    answer = jQuery(answer);
    jQuery("#answers").append(answer);

    var lang = a.language;
    if (/ b.lang) return 1;
    if (a.lang < b.lang) return -1;
    return 0;
  });

  for (var i = 0; i < langs.length; ++i)
  {
    var language = jQuery("#language-template").html();
    var lang = langs[i];
    language = language.replace("{{LANGUAGE}}", lang.lang)
                       .replace("{{NAME}}", lang.user)
                       .replace("{{SIZE}}", lang.size)
                       .replace("{{LINK}}", lang.link);
    language = jQuery(language);
    jQuery("#languages").append(language);
  }

}
body { text-align: left !important}

#answer-list {
  padding: 10px;
  width: 290px;
  float: left;
}

#language-list {
  padding: 10px;
  width: 290px;
  float: left;
}

table thead {
  font-weight: bold;
}

table td {
  padding: 5px;
}

<link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">

Leaderboard

	Author	Language	Size

Winners by Language

Language	User	Score

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

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

The multicase key test case looks wrong; there are 5 different letters in the key so the u in 16th position can't end up in 14th position, since that's now a different block of 5.

What do you mean by "surplus space at the end of your columns is not padded."? Can you give a worked example of a case where it's relevant?

Is case in the key ignored? If so, is that before or after ignoring duplicates? Also, please state all rules explicitly, don't make us infer them from the test cases

I still don't get your 2nd test case: the 13th letter (i from in) should be in 11th place in the result: it is put into first place of it's chunk because it lines up with a from the key.

@nimi I see no problem with it...

@GeorgeGibson It' a pity, the challenge seemed interesting. I hope you can clarify the points above and it can be reopened

@LuisMendo Rules have been made clearer, I will do a 'surplus space' example in a minute.

@GeorgeGibson Also, in the second case I get yKce  aenbn mi tuclieas!. It may be my mistake, but in any it should be explained how the output is obtained in that case

@MorganThrapp Done.

@LuisMendo You are  correct (almost), and I will edit.

@MorganThrapp Padding at the end of columns aside, yes.

MATL, 12 bytes
kune2M&SY)1e

Try it online!
Explanation
The code works using rows instead of columns. This is totally equivalent and fits better with MATL's column-major indexing.
k     % Take first input (key) implicitly. Convert to lowercase
u     % Keep unique chars, stably
n     % Number of unique chars
e     % Take second input (message) implicitly. Reshape into char matrix
      % with the above number of rows, padding with zeros if needed
2M    % Push string with unique chars of key again
&S    % Sort and push the indices of the sorting
Y)    % Use as row indices into char matrix
1e    % Reshape into a row. Zeros are displayed as spaces

The way u, e, M, and & work is so impressive here

@David indeed! :-)

haha, "kune" - thats the currency we use in Croatia

Python 3, 188 bytes.
There's gotta be a saner way to do this.
from itertools import*
def f(a,b):a,c,s=a.upper(),''.join,sorted;return c(map(c,zip_longest(*[v for k,v in s([(v,b[i::len({*a})])for i,v in enumerate(s({*a},key=a.find))])],fillvalue='')))

Test cases:
assert f('goat', 'Hello World!') == 'lHelWo odrl!'
assert f('GOAT', 'Hello World!') == 'lHelWo odrl!'
assert f('GOAATAT', 'Hello World!') == 'lHelWo odrl!'
assert f('CBABD', 'Duplicates are ignored.') == 'puDlacit sea eriongr.de'

Well that was a fun journey back to square one.

Save 1 byte by abstracting len() to a 1-letter function

@Blue That doesn't save me any bytes. lambda a,b,l=len:''.join(map(''.join,zip(*[v for k,v in sorted([(ord(v),[l for l in b[i::l(a)]])for i,v in enumerate(a.upper()+' '*(l(b)%l(a)))])]))) is also 149.

ah, I forgot about the comma. Sorry

JavaScript (ES6), 170 bytes
(k,s)=>[...s].map((c,i)=>(i%l||(r+=t.join``,t=[]),t[[...k].sort().search(k[i%l])]=c),k=[...k=k.toLowerCase()].filter((c,i)=>i==k.search(c)),l=k.length,r=t=[])&&r+t.join``

Preprocessing the key is a waste of 56 bytes...

Python 3.5, 139
def f(a,b):a,s,j=a.lower(),sorted,''.join;a=s({*a},key=a.find);l=len(a);return j(map(j,[*zip(*s(zip(*zip(*[iter(a+[*b+' '*l])]*l))))][1:]))

Slightly more readable version:
def f(a, b):
    a = a.lower()
    # Remove duplicates
    a = sorted({*a}, key=a.find)
    l = len(a)
    # Add the key
    z = zip(*[iter(a + [*b, *[''] * l])]*l)
    # Sort tuples lexicographically, remove the key
    z = [*zip(*sorted(zip(*z)))][1:]
    return ''.join(map(''.join, z))

Well, this wins for most calls to zip in one answer.

Javascript, 155 159 149 151
(w,s)=>(a='',z=new Set,w=[...[...w].map(z.add,z)[0]].sort(),eval(`s.match(/.{1,${z.size}}/g)`).map(l=>[...l].map((c,i)=>a+=l[[...z].indexOf(w[i])]||'')),a)

Saved 4 bytes thanks @Bergi.

Here it goes, ungolfed and explained:

function ColumnarTranspositionCipher(word, sentence) {
    var answer = "";

    // the own methods of Set does it shorter than a raw Object
    var z = new Set;

    // As Set only allows unique keys, we get the processed key by adding
    [...word].forEach(function(letter) {
        z.add(letter);
    });

    // word now has the sorted key
    word = [...z].sort(),

    // divide sentence by the processed key's length
    sentence = sentence.match(RegExp(".{1," + z.size + "}", "g"));

    sentence.forEach(function(row) {
        [...row].forEach(function(letter, newIndex) {

            // get the old index - relative to the previous sorted/unsorted keys
            var oldIndex = [...z].indexOf(word[newIndex]);

            // and add to the answer
            answer += row[oldIndex] || "";
        });
    });

    return answer;
}

r= code=> output.innerHTML += '\n>  ' + code + '\n<- "' + eval(code) + '"\n';
r("ColumnarTranspositionCipher('GOAT', 'Hello World!')");
r("ColumnarTranspositionCipher('CBABD', 'Duplicates are ignored.')");
r("ColumnarTranspositionCipher('aBeCd', 'Key can be in multicase!')");

Haskell, 98 84 83 bytes
import Data.List
h c=map snd.sort.zip((<$>nub((`mod`32).fromEnum<$>c)).(,)=<<[1..])

Usage example: h "CBAbD" "Duplicates are ignored." -> "puDlacit sea eriongr.de".
How it works:
       nub((`mod`32).fromEnum<$>c)  -- turn key to lowercase and remove duplicates
    (<$>      ).(,)=<<[1..]         -- make pairs of (number , char from key)
                                    -- for every character in the key and every
                                    -- number starting with 1. This builds and
                                    -- infinite list, e.g. for the key "cba":
                                    -- (1,c),(1,b),(1,a),(2,c),(2,b),(2,a),(3,c)...
              zip(          )       -- zip this list with input String, e.g. for
                                    -- the string "mnopq" with the key from above:
                                    -- ((1,c),m),((1,b),n),((1,a),o),((2,c),p),((2,b),q)
                                    -- zip stops at the end of the shorter list
         sort                       -- sort lexicographically
 map snd                            -- extract characters of the string

J, 53 bytes
(3 :',/|:((/:tolower~.>0{y){|:((-#~.>0{y),\(>1{y)))')

Usage example: (3 :',/|:((/:tolower~.>0{y){|:((-#~.>0{y),\(>1{y)))') ('ADCB';'"Good Morning!" he called.') ==> "ooGdoM rning "!hc eaelld  .
I basically did exactly what the cipher does, no shortcuts. I had to transpose the matrix to deal with ranking the columns then transpose it back.
Try it Online! (make sure to type "j-bot: " without quotes then paste the code.)

Hello, and welcome to PPCG! Great first post!

R, 182 177
Here is the golfed version:
function(t,k){k=unique(unlist(strsplit(tolower(k),"")));t=unlist(strsplit(t,""));l=length(t);c=length(k);r=ceiling(l/c);t=c(t,rep("",c*r-l));cat(matrix(t,r,c)[order(rank(k)),])}

And ungolfed version, which shows how the function takes the data.
# test data
key = "aBeCd"
test = "ABCDEabcdeABCDEabcdeABC!"

# t is the test phrase, k is the key
cipher=function(t,k){
    k=unique(unlist(strsplit(tolower(key),"")))
    t=unlist(strsplit(test,""))
    l=length(t)
    c=length(k)
    r=ceiling(l/c)
    t=c(t,rep("",c*r-l))
    cat(matrix(t,r,c)[order(rank(k)),])
}

# Show that it works
cipher(test,key)
## A B D E C a b d e c A B D E C a b d e c A B !  C

The test cases provided by the OP seem incorrect. I intentionally chose a test case here that makes it more clear what is happening to the letters, and this seems correct.

You take in t and k as aeguments, then yiu use test and key

Yes, that is how my example works.

In the main code, you still reference test and key

Ruby, 133 bytes
Zip, sort, zip again, combine.
->k,s{k=k.upcase.chars.uniq
c,*r=k.zip(*s.scan(/.{1,#{k.size}}/).map(&:chars)).sort
c.zip(*r.map{|e|e ?e:' '})[1..-1].map(&:join)*''}

Q, 52 Bytes
f:{n:#u::?_x;,/+(+(0N;n)#(n*-_-(#y)%n)#y,n#" ")@<u}

NOTE.- defined as function named f to facilitate tests. As an anonymous function we delete chars f: (50 Bytes)
Test
Interpreter (evaluation but unrestricted) downloadable by not fee at kc.com (windows/linux/mac versions)
f["CBABD"]"Duplicates are ignored."     /"puDlacit sea eriongr.de"
f["bDaEc"]"Key can be in multicase!"    /"yKce  aenbn mi tucliea s!"

Explanation
n:#u:?_x u is unique chars in lowercase key, and n its length
(n*-_-(#y)%n)#y,n#" " appends blanks to accomplish 'space surplus' rule.
% is division
-_- implements ceil as negate floor negate, so (n*-_-(#y)%n) is the length required by space surplus. y,n#" " append n blank spaces to end of text, and then take length of that extended text
(0N;n)#.. takes items of sequence .. to fill a matrix of n columns by row

+(..) flip that matrix (traspose) to work by rows
@<u selects row indexes by ascending index order of u
,/(..) concatenates the resulting matrix to obtain a text

source: Stack Exchange

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

sort: votes


text:
Fix my Basic Orthography
Fix my Basic Orthography
While I am excellent at following the English capitalisation rules when writing, when I am typing I have a habit a capitalising almost everything (as you will see from the titles of my challenges). I need a program to fix that, but because I use so many capitals, and capitals are big letters, your program must be as short as possible.
Requirements

Your program should take each word, and if it is the first alphanumeric set of characters after a full stop or the beginning of the input, capitalize the first letter. All the rest of the letters until the next full stop will be lowercase.  At the full stop, capitalize the first letter and continue.
Punctuation must be preserved.
In a sentence without a full stop at the end, that should be added.
Spaces, where missing, should be inserted. A space is 'missing' if there is nothing between a full stop and the character following it.

(Note for americanish speakers: full stop = period = .)
Test Cases
tHIS SenteNce HAS veRy bAd GrammAr. ==> This sentence has very bad grammar.

-----

PuncTuation must-be PReserved. ==> Punctuation must-be preserved.

-----

full StOps ShoulD Be inserted ==> Full stops should be inserted.

-----

MultiPLe sEntEnceS Are possible. thEY Are, yoU KNOW. ==> Multiple sentences are possible. They are, you know.

-----

spaces. are.inserted. ==> Spaces. Are. Inserted.

Rules

Your program should take input as an argument or from STDIN (or the closest alternative in your language).
Standard loopholes are forbidden.

Scoring
When code-golf is the tag, it's the least bytes to win!
Submissions
To make sure that your answer shows up, please start your answer with a headline, using the following Markdown template:
# Language Name, N bytes

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

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

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

Leaderboard

/* Configuration */

var QUESTION_ID = 79842; // Obtain this from the url
// It will be like https://XYZ.stackexchange.com/questions/QUESTION_ID/... on any question page
var ANSWER_FILTER = "!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe";
var COMMENT_FILTER = "!)Q2B_A2kjfAiU78X(md6BoYk";
var OVERRIDE_USER = 53406; // This should be the user ID of the challenge author.

/* App */

var answers = [], answers_hash, answer_ids, answer_page = 1, more_answers = true, comment_page;

function answersUrl(index) {
  return "https://api.stackexchange.com/2.2/questions/" +  QUESTION_ID + "/answers?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + ANSWER_FILTER;
}

function commentUrl(index, answers) {
  return "https://api.stackexchange.com/2.2/answers/" + answers.join(';') + "/comments?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + COMMENT_FILTER;
}

function getAnswers() {
  jQuery.ajax({
    url: answersUrl(answer_page++),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function (data) {
      answers.push.apply(answers, data.items);
      answers_hash = [];
      answer_ids = [];
      data.items.forEach(function(a) {
        a.comments = [];
        var id = +a.share_link.match(/\d+/);
        answer_ids.push(id);
        answers_hash[id] = a;
      });
      if (!data.has_more) more_answers = false;
      comment_page = 1;
      getComments();
    }
  });
}

function getComments() {
  jQuery.ajax({
    url: commentUrl(comment_page++, answer_ids),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function (data) {
      data.items.forEach(function(c) {
        if (c.owner.user_id === OVERRIDE_USER)
          answers_hash[c.post_id].comments.push©;
      });
      if (data.has_more) getComments();
      else if (more_answers) getAnswers();
      else process();
    }
  });
}

getAnswers();

var SCORE_REG = /<h\d>\s*([^\n,]*[^\s,]),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/;

var OVERRIDE_REG = /^Override\s*header:\s*/i;

function getAuthorName(a) {
  return a.owner.display_name;
}

function process() {
  var valid = [];

  answers.forEach(function(a) {
    var body = a.body;
    a.comments.forEach(function(c) {
      if(OVERRIDE_REG.test(c.body))
        body = '
' + c.body.replace(OVERRIDE_REG, '') + '
';
    });

    var match = body.match(SCORE_REG);
    if (match)
      valid.push({
        user: getAuthorName(a),
        size: +match[2],
        language: match[1],
        link: a.share_link,
      });

  });

  valid.sort(function (a, b) {
    var aB = a.size,
        bB = b.size;
    return aB - bB
  });

  var languages = {};
  var place = 1;
  var lastSize = null;
  var lastPlace = 1;
  valid.forEach(function (a) {
    if (a.size != lastSize)
      lastPlace = place;
    lastSize = a.size;
    ++place;

    var answer = jQuery("#answer-template").html();
    answer = answer.replace("{{PLACE}}", lastPlace + ".")
                   .replace("{{NAME}}", a.user)
                   .replace("{{LANGUAGE}}", a.language)
                   .replace("{{SIZE}}", a.size)
                   .replace("{{LINK}}", a.link);
    answer = jQuery(answer);
    jQuery("#answers").append(answer);

    var lang = a.language;
    if (/ b.lang) return 1;
    if (a.lang < b.lang) return -1;
    return 0;
  });

  for (var i = 0; i < langs.length; ++i)
  {
    var language = jQuery("#language-template").html();
    var lang = langs[i];
    language = language.replace("{{LANGUAGE}}", lang.lang)
                       .replace("{{NAME}}", lang.user)
                       .replace("{{SIZE}}", lang.size)
                       .replace("{{LINK}}", lang.link);
    language = jQuery(language);
    jQuery("#languages").append(language);
  }

}
body { text-align: left !important}

#answer-list {
  padding: 10px;
  width: 290px;
  float: left;
}

#language-list {
  padding: 10px;
  width: 290px;
  float: left;
}

table thead {
  font-weight: bold;
}

table td {
  padding: 5px;
}

<link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">

Leaderboard

	Author	Language	Size

Winners by Language

Language	User	Score

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

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

"and capitals are big letters, your program must be as short as possible." .......

We only get 1 sentence?

@Bálint Not strictly so, I will add another test case.

Do we need to insert a space after full stop?

@Bálint Only if there is a space in the original.

Why exclude Matlab (I know I can use Octave), Mathematica and the like if it can be shown that they work? It makes sense in CnR challenges, but I don't like it in code golf. Sorry, but -1 until that rule is changed.

What about exclamation mark? (!)

The extra requirements (or even the restating of them) for function vs program are unnecessary, we have defaults for that.

@StewieGriffin Updated.

@EᴀsᴛᴇʀʟʏIʀᴋ Removed.

@GeorgeGibson seriously, the extra rules like you must provide a link and your program must not write anything to STDERR are really not important.  Actually, the whole "Rules" section could go.

@EᴀsᴛᴇʀʟʏIʀᴋ OK, removed.

What should I change to make this challenge more clear?

Based on your test cases, it seems like there's more than just letters, spaces and . in the inputs (e.g. - and ,). In that case, is something like Sentence one. "sentence two valid input? (i.e. first non-space after full stop is not a letter) 2) Regarding "if it is directly after a full stop or the beginning of the input, capitalize the first letter", I'm assuming you don't mean directly directly, but possibly with spaces in between the full stop and the next letter. What do we do with inputs with no spaces in between, or more than one space (or are they invalid inputs?)

@Sp3000 Any better?

Looks better - just for completeness, I guess if a space is missing then it gets added? e.g. a.b becomes A. B.

(Also, I think these changes invalidate some existing answers, so it might be good to let people know that the challenge has been clarified via comments)

@Sp3000 Good point, yes.

@muddyfish Thanks, the test case has been fixed (force of habit). Also, I have. See requirement 2: Punctuation must be preserved.

@muddyfish No, the speech marks are punctuation, and are left untouched. The space would be put after them.

@muddyfish Give me a minute...

@muddyfish OK, I'll change the spec as you have a good point.

None of this question has anything to do with grammar. You also need to fix your basic vocabulary: the word for how things should be written is orthography.

Spaces, when missing ... when are spaces missing? It seems that there are many rules that can be inferred only looking at the test cases

"In a sentence without a full stop at the end, that should be added." How do we know it's the end of a sentence?

Why did you collapse the duplicate space before "Really" in one of your test cases? I see nothing in the rules about that.

"Your program should take each word, and if it is directly after a full stop or the beginning of the input, capitalize the first letter." So A sentence. #2 sentence. should remain as is but A sentence. #2sentence. should become A sentence. #2Sentence., right?

@msh210 Sorry, what I meant was 'at the end of your input'.

@edc65 Fixed. Are there any others?

@msh210 I will remove that test case, I thought I'd added that in the rules, but it seems otherwise.

@msh210 No, I'd just worded that badly. I will edit.

@msh210 Done. Hopefully your points have now been resolved.

Ouput for 'A  '? (A,space,space) 'A.' or 'A(space) .' or 'A(space)(space).'?

@edc65 The output would be A(space)..

Pyke, 16 bytes
Q\.cFl8l5DI\.+(J

Try it here!
(15 bytes after a bugfix)
\.cFl8l5DI\.+(J

Explanation:
Q\.c             -  input().split(".")
    F            - for i in ^:
     l8l5        -  i = i.lstrip().capitalise()
          I      -  if i:
           \.+   -   i += "."
               J - " ".join(^)

Vim, 40 39 keystrokes
VgugUl:s/\. *\(\a\)/\. \U\1/g<cr>:s/\.$<cr>A.

This assumes that input will not take multiple lines.
Explanation:
Vgu                                            "Make the whole line lowercase
   gUl                                         "Make the first character uppercase
       :s/\. *\(\a\)/\. \U\1/g<cr>             "Replace a (.) followed by any number of
                                               "spaces, followed by a character, with
                                               "with a (.), one space, and that character
                                               "In lowercase
                                  :s/\.$<cr>   "Remove a dot, if it's at the end of this line
                                            A. "Add a dot to the end of this line.

JavaScript (ES6), 76 95 bytes

f=
s=>s.replace(/ +/g,' ').replace(/(\w)([^.]*)\.?/g,(_,c,r)=>c.toUpperCase()+r.toLowerCase()+'.')
input{width:100%;
<input oninput=o.value=f(this.value)><input id=o>

@Bálint I can do better than that: my function can be tested on this site!

Edit the byte count

Please update so multiple spaces are replaced with one.

Python 3, 86 80 bytes
print('. '.join(x.strip().capitalize() for x in input().split('.') if x!='')+'.')

This works for all of the current test cases, but not for much beyond that.
Thanks @muddyfish for 6 bytes.
https://repl.it/CQ7h/0

print('. '.join(x.strip().capitalize() for x in input().split('.')if x!='')+'.') is shorter

print('. '.join(x.strip().capitalize()for x in input().split('.')if x)+'.') is shorter still and print'. '.join(x.strip().capitalize()for x in input().split('.')if x)+'.' if you're willing to go python 2

I think you can also save 4 more by dropping the !=''.

Isn't there an useless whitespace before the if statement?

Retina, 41 bytes
S-`\. *
%(T`L`l
T`l`L`^.
)`(?<!\.)$
.
¶
<space>

Try it online!
Test suite.

Please update to comply with the revised rules.

Ruby, 50 bytes
Basic split/map/join solution.
->s{s.split(?.).map{|e|e.strip.capitalize+?.}*' '}

V, 25 bytes (non-competing)
guGgUló® *¨á©/® Õ±
ó®$
A.

Try it online!
This isn't super creative, since it's just a direct port of my vim answer. However, it's a lot shorter, so I'm happy with it.
Due to an oversight, this is one or two bytes longer than it needs to be. That should be fixed soon.

PHP, 123 103 102 95 92 bytes
<?foreach(explode('.',trim(fgets(STDIN)))as$b)echo!$b?!1:ucfirst(strtolower(trim($b))).'. ';

Takes a newline-terminated line from STDIN and prints the fixed version to STDOUT.

Perl, 40 + 12 (flags) = 52 bytes
#!perl -paF\.\s*
map{s/\s*$/. /;$\.=ucfirst lc}@F}{chop$\

Using:
echo "foo.baz. bar" | perl -paF'\.\s*' -e 'map{s/\s*$/. /;$\.=ucfirst lc}@F}{chop$\'

Ungolfed:
while (<>) {
    my @F = split(/\.\s*/, $_);
# code above added by -paF\.\s*
    # $\ has undef (or '')
    for (@F) {
        $_ =~ s/\s*$/. /;
        $\ .= ucfirst(lc($_));
    }
} {
    chop($\);
# code below added by -p
    print;  # prints $_ (undef here) and $\
}

Ideone.

Lua, 149 141 bytes
u=function(l)return l:upper()end print(io.read():lower():gsub("%s+"," "):gsub("%.([^%s])",". %1"):gsub("^(%w)",u):gsub("(%.[^%w]*%w)",u).."")

Lua lacks some common features of regular expressions, and so it had to get a little sloppier than I would have liked. I might try to fix it up later though.

Q 78 Bytes
(76 if anonymous function)
f:{(". "/:{{@[(" "=*x)_x;0;"c"$-32+"i"$]}'"."\:_-1_x}x),$["."=u:*|x;u;u,"."]}

Test
f"tHIS SenteNce HAS veRy bAd GrammAr."                  /This sentence has very bad grammar.
f"PuncTuation must-be PReserved."                       /Punctuation must-be preserved.
f"full StOps ShoulD Be inserted"                        /Full stops should be inserted.
f"MultiPLe sEntEnceS Are possible. thEY Are, yoU KNOW." /Multiple sentences are possible. They are, you know.
f"spaces. are.inserted."                                /Spaces. Are. Inserted.

Q has lower and upper functions (conversion to lowercase and to uppercase), but more primitive sub-language k (concise, used in the example) only has lower (operator _), so part of the text (12 bytes "c"$-32+"i"$) implements upper.
Split the original string using ". " as separator, processes each line, and join again
For each line we discard first character if is a blank (join inserts a blanck after each .), and capitalice first character.
Finally, insert a final "." if last char is not "."

Perl 5, 42 bytes
say map{$_=ucfirst lc.'. '}split/\.\s*/,<>

Try it online!

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

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


text:
Fibonacci products
You can decompose a number greater than 0 as a unique sum of positive Fibonacci numbers. In this question we do this by repeatedly subtracting the largest possible positive Fibonacci number. E.g.:
1 = 1
2 = 2
3 = 3
4 = 3 + 1
12 = 8 + 3 + 1
13 = 13
100 = 89 + 8 + 3

Now, I call a Fibonacci product the same lists as above, but with the addition replaced by multiplication. For example, \$f(100) = 89 \times 8 \times 3 = 2136\$.
Write a program or function that given a positive integer n returns the Fibonacci product of that number.

Testcases:
1: 1
2: 2
3: 3
4: 3
5: 5
6: 5
7: 10
8: 8
9: 8
42: 272
1000: 12831
12345: 138481852236

The statement isn't quite correct. E.g. 2 can be decomposed as -1 + 3. The correct statement of Zeckendorf's theorem is that a positive Fibonacci number can be uniquely decomposed as a sum of non-consecutive Fibonacci numbers with positive index.

@PeterTaylor I don't consider negative Fibonacci numbers part of the series for this question. Consecutive or not only matters when you want the indices, we do not care about the indices for this question.

I'm not saying that you should change the question to support negative Fibonacci numbers: I'm saying that you should edit it to be explicit about the assumptions which you're making.

@orlp consecutive or not matters quite a bit, since two different forms would give two different products. You already stated the problem in a way that already implicitly rules out consecutive Fibonacci terms, though, so there's nothing to worry about there.

(specifically: F(n) and F(n+1) can't both appear in the output because the algorithm guarantees that, before considering them, the remainder is already less than F(n+2) = F(n) + F(n+1))

Jelly, 16 15 bytes
Rf1+Ð¡¤ṪạµÐĿIAP

Not particularly fast or memory friendly, but efficient enough for all test cases. Try it online!
How it works
Rf1+Ð¡¤ṪạµÐĿIAP  Main link. Argument: n (integer)

         µ       Combine the chain to the left into a link.
          ÐĿ     Apply that link until the results are no longer unique.
                 Return the list of unique results.
      ¤            Combine the two links to the left into a niladic chain.
  1                  Set the left (and right) argument to 1.
   +D¡               Apply + to the left and right argument, updating the left
                     argument with the sum, and the right argument with the
                     previous value of the left one. Return the list of results.
                     Repeat this process n times.
                   This yields n + 1 Fibonacci numbers, starting with 1, 2.
R                  Range; map k to [1, ..., k].
 f                 Filter; keep the items in the range that are Fibonacci numbers.
       Ṫ           Tail; yield the last one or 0 if the list is empty.
        ạ          Absolute difference with k.
                   This is the argument of the next iteration.
            I    Compute the increments of the arguments to the loop, yielding
                 the selected Fibonacci numbers (with changed sign).
             A   Apply absolute value to each.
              P  Compute their product.

This seems big, Dennis.

Python, 54 bytes
f=lambda n,a=1,b=1:n<1or b>n and a*f(n-a)or f(n,b,a+b)

Just some good old recursion.

Perl, 69 63 + 4 (-pl61 flag) = 67 bytes
#!perl -pl61
while($_){$n=$m=1;($n,$m)=($m,$n+$m)until$m>$_;$_-=$n;$\*=$n}}{

Using:
> echo 42 | perl -pl61e 'while($_){$n=$m=1;($n,$m)=($m,$n+$m)until$m>$_;$_-=$n;$\*=$n}}{'

Ungolfed:
while (<>) {
# code above added by -p
    # $_ has input value
    # $\ = 1 by -l61
    while ($_ != 0) {
        my $n = 1;
        my $m = 1;
        while ($m <= $_) {
            ($n, $m) = ($m, $n + $m);
        }
        $_ -= $n;
        $\ *= $n;
    }
} {
# code below added by -p
    print;  # prints $_ (undef here) and $\
}

Ideone.

The explanation should mention that octal 061 is the ASCII encoding for the character '1'.  Nice hack to use $\ to get it printed for near-free.

><>, 57 bytes
111\ ;n{/
:@+>:{:})?\$:@@
~{*}:0=?\}>:0${:})?$~:{$-$:1@?$

Expects the input number to be present on the stack at program start.
Builds up the Fibonacci sequence (f0, f1, f2, ..., fn) on the stack until a number is reached that is greater than the the input (i). Then, with a product (p) initialised to 1...
while (i != 0)
   if (fn <= i)
      i = i - fn
      p = p * fn
   else
      i = i - 0
      p = p * 1
   discard fn
output p

Try it out online!

Nice! I suggest you post a link using an online compiler

JavaScript (ES6), 78 42 bytes
f=(n,a=1,b=1)=>n?b>n?a*f(n-a):f(n,b,a+b):1

Port of @Sp3000's answer. Original 78 byte version:
f=(n,a=[2,1])=>n>a[0]?f(n,[a[0]+a[1],...a]):a.map(e=>e>n?0:(r*=e,n-=e),r=1)&&r

Haskell, 44 bytes
Yay for mutual recursion:
(a&b)c|c<1=1|b>c=a*f(c-a)|d<-a+b=b&d$c
f=0&1

a is the previous Fibonacci number
b is the current Fibonacci number
c is the input
f is the desired function

Less golfed:
(a & b) c | c == 0    = 1
          | c <  b    = a * f (c-a)
          | otherwise = b & (a + b) $ c
f x = (0 & 1) x

Jelly, 10 bytes
ŒṗḟÐḟÆḞ€ṪP

Try it online!
Times out for \$n > 60\$
How it works
ŒṗḟÐḟÆḞ€ṪP - Main link. Takes n on the left
Œṗ         - Integer partitions of n
     ÆḞ€   - First n Fibonacci numbers
   Ðḟ      - Keep the partitions p which yield an empty list under:
  ḟ        -   Remove all elements of p which are in the first n Fibonacci numbers
        Ṫ  - Take the last element
         P - Product

Pyth, 28 bytes
K1WQJ0 .WgQH+Z~JZ1=*KJ=-QJ;K

I think it can be golfed much further...
Try it online!

Javascript (ES6) 134 106 92 bytes
Thanks for @cat for spotting a space.
n=>{for(c=[a=b=s=1,1];a+b<=n;)a+=b,c.unshift(b+=a,a);c.map(i=>i<=n&&(n-=i)&(s*=i));alert(s)}

Just an unoptimized version made on my phone, I golf it down, once I get home. Ideas are welcome.

There's one superflouous whitespace. :P

Pyth, 24 bytes
W=-QeaYh.WgQeH,eZsZ1;*FY

Try it online: Demonstration or Test Suite
Explanation:
Q is assigned with the input number.
The part h.WgQeH,eZsZ1 calculates the biggest Fibonacci number, that is smaller or equal to Q
h.WgQeH,eZsZ1
            1   start with H=Z=1
 .WgQeH         while Q >= end(H):
       ,eZsZ       H=Z=(end(Z), sum(Z))
h               first

So if Q = 10, it generates the numbers/pairs:
1 -> (1,1) -> (1,2) -> (2,3) -> (3,5) -> (5,8) -> (8,13) -> 8

The rest of the code calculates the partition and multiplies the numbers together:
W=-QeaY...;*FY    implicit: Y = empty list
     aY...        add the calculated Fibonacci number to the empty list
    e             take the last element of Y (yes the number we just added)
 =-Q              and update Q with the difference of Q and ^
W         ;       continue until Q == 0
           *FY    multiply all number in Y and print

There are obviously a lot of shorter solutions (with really bad run-times though), like *FhfqQsTyeM.u,eNsNQ1.

Actually, 22 bytes
W;╗uR♂F;`╜≥`M░M;╜-WXkπ

Try it online!
Explanation:
W;╗uR♂F;`╜≥`M░M;╜-WXkπ
                        (implicit input)
W                 W     while top of stack is truthy:
 ;╗                       push a copy of n to reg0
   uR♂F;                  push 2 copies of [Fib(a) for a in range(1, n+2)]
        `╜≥`M░            filter: take values where n <= Fib(a)
              M;          two copies of maximum (call it m)
                ╜-        subtract from n (this leaves n-m on top of the stack to be the new n next iteration, with a copy of m below it)
                   X    discard the 0 left over after the loop ends
                    kπ  product of all stack values

Does Actually have its own encoding? I count 35 bytes across 22 chars. https://mothereff.in/byte-counter#W%3B%E2%95%97uR%E2%99%82F%3B%60%E2%95%9C%E2%89%A5%60M%E2%96%91M%3B%E2%95%9C-WXk%CF%80

@cat Just like Seriously, it uses CP437.

RETURN, 44 bytes
[a:[a;][1$[¤¤+$a;->~][]#%$␌a;\-a:]#␁[¤][×]#]

Try it here.
Astonishingly inefficient anonymous lambda that leaves result on Stack2. Usage:
12345[a:[a;][1$[¤¤+$a;->~][]#%$␌a;\-a:]#␁[¤][×]#]!

NOTE: ␌ and ␁ are placeholders for their respective unprintable chars: Form Feed and Start of Heading.
Explanation
[                                           ]  lambda
 a:                                            store input to a
   [  ][                         ]#            while loop
    a;                                           check if a is truthy
        1$[¤¤+$a;->~][]#%                        if so, generate all fibonacci numbers less than a
                         $␌                      push copy of TOS to stack2
                           a;\-a:                a-=TOS
                                   ␁[¤][×]#   get product of stack2

I count 46 bytes across 42 chars. If RETURN uses some kinda special encoding, it should be 42 bytes across 42 chars, but it appears to be unicode, so it's 46.

Actually, I just realized that I forgot to put in some unprintables.

I needed a microscope to tell what they are, so I linked to them for you. :D (I couldn't tell if it was SOH or BOM)

PHP, 119 bytes
The code (wrapped on two lines for readability):
for($o=$c=1;$c<=$n=$argv[1];$f[++$k]=$c,$a=$b,$b=$c,$c+=$a);
for($i=$k;$i;$i--)for(;$n>=$d=$f[$i];$n-=$d,$o*=$d);echo$o;

The first line computes in $f the Fibonacci numbers smaller than $n (the argument provided in the command line). The second line computes the Fibonacci factors (by subtraction) and multiplies them to compute the product in $o.
Prepend the code with <?php  (technically not part of the program), put it in a file (fibonacci-factors.php) then run it as:
$ php -d error_reporting=0 fibonacci-factors.php 100
# The output:
2136

Or run it using php -d error_reporting=0 -r '... code here ...' 100.
The ungolfed code and the test suite can be found on Github.

Q, 47 Bytes
m:{*/1_-':|(0<){y-x x bin y}[*+60(|+\)\1 0]\x}

Test
+(i;m'i:1 2 3 4 5 6 7 8 9 42 1000 12345)

read it as pairs (i,map(m,i)), where m is the calculating function and i the different args
writes
1     1
2     2
3     3
4     3
5     5
6     5
7     10
8     8
9     8
42    272
1000  12831
12345 138481852236

Explanation
n funtion\arg    applies function(function(function(...function(args))) n times (internally uses tal recursion), and returns the sequence of results. We calculate the 60 first items of fibonnaci series as *+60(|+\)\1 0. In that case the function is (|+): +\ applied over a sequence calculates partial sums (ex +\1 2 3 is 1 3 6), and | reverses seq. So each 'iteration' we calculate partial sums of the two previous fibonacci number and return the partial sums reversed. 60(|+\)\1 0 generates sequences 1  0, 1  1, 2  1, 3  2, 5  3, 8  5, 13 8, 21 13, ... *+ applied over this result flip (traspose) it and takes the first. Result is sequence 1 1 2 3 5 8 13 21 34 55 ..
(cond)function\args applies function(function(..function(args))) while cond true, and returns the sequence of partial results
function[arg] applied over a function of more than one argument creates a projection (partial application)
We can give name to the args, but the implicit names are x,y,z
{y-x x bin y}[*+60(|+\)\1 0] declares a lambda with args x,y with partial projection (arg x is fibonacci series, calculates as *+60(|+)\1 0). x represent fibonacci values, and y the number to process. Binary search (bin) is used to locate the index of the greater fibonacci number <=y (x bin y), and substract the corresponding value of x.
To calculate product from partial resuls we reverse them and calculate difference of each pair (-':|), drop the first (1_ because is 0) and multiply over (*/).
If we are interested in accumulated sum the code is the same, but with +/ instead of */. We can also use any other diadic operator instead of + or *
About execution efficiency
I know that in this contest efficiency is not an issue. But in this problem we can range from lineal cost to exponential cost, so i'm curious about it.
I developed a second version (length 48 Bytes excluding comment) and repeated test cases battery 1000 times on both versions.
f:*+60(|+\)\1 0;m:{*/1_-':|(0<){x-f f bin x}\x}    /new version

execution time is: original version 0'212 seg, new version 0'037 seg
Original version calculates fibbonaci serie once per function application; new version calculates fibonacci just one.
In both cases calculation of fibonacci series uses tail recursion

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


text:
Calculate the Trump Tax
If elected president, Donald Trump plans to implement a system of four income tax brackets (full details can be found on his website here). Your job is to take two inputs, annual income and filing status (single, married, or head of household), and output the income tax that must be paid.
Income Tax Brackets

(We are only interested in the income tax rate; you can ignore the long-term capital gain rate).
Note that income taxes are computed using marginal rates — that is, you only pay the bracket rate for the portion that exceeds the bracket's minimum amount.
For example, a single filer making $45,000 a year would pay 0% on the first $25,000, and 10% on the $20,000 after that, for a total of $2,000 in taxes.
A married couple filing jointly for $500,000 would count 25% only on the amount exceeding $300,000, and add $45,000 to that to account for the income earned in lower brackets (which is 10% of $50,000 plus 20% of $200,000).
Input/Output
Input/Output is flexible. You can take input as command-line arguments or prompt for inputs, as well as either return or output/display the result. The inputs and output must be numbers, but you are free to determine what the second number would be (for example, 0 = single, 1 = married, 2 = head of household). Just don't be ridiculous - Single digit numbers only.
Also, functionality for decimal inputs (i.e. including cents) is undefined, so you only have to worry about integer inputs. For your output, you may either output a decimal value or round it to the nearest whole number.
Test Cases
Although the second number's range can be flexible as stated above, these test cases assume that 0 = single, 1 = married, and 2 = head of household:
25000  0 --> 0
37501  2 --> 0.1 or 0
51346  1 --> 134.6 or 135
75000  0 --> 7500
75000  1 --> 2500
123456 2 --> 13441.2 or 13441
424242 0 --> 91060.5 or 91061

Closely related

You are advised to wait for at least a day, preferably two days, before posting your question.

How much information can I encode in the second input?

@KennyLau By "don't be ridiculous", how about single digit numbers only...

Then say that explicitly.

Why not just say "you may not encode program information in the input"?

Because that would be too broad. Even 0, 1, 2 can be considered "program information"

Does the tax amount really jump up when you cross a boundary? I thought that tax brackets  work that you pay 0% for the first $25000 if single, then 10% for the portion between 25000 and 50000, and so on.

@xnor This is what I thought too. Timtech's testing inputs are wrong.

The link in the question is dead. Here is the archive entry

Pyth, 32 bytes
*c@_j270588 6shS,6ca0tQ*12500E20

Test suite.

2 = single
4 = married
3 = head of household

Some ridiculous encodings:
Previous 6-byte:
JQ.vCE

Test suite.

74892585093965377905208487730659359537614936740881725652453863997600444976 = single
74892585093965377905208487730659359537614936740881725652668629404830675504 = married
74892585093965377905208487730659359537614936740881725652526490039149933104 = head of household

Encodes the whole program into the second number.
Previous 24-byte:
JjE^T6*c@tJhS,7shctQhJ20

Test suite.

25000000000000000000002000004000004000004000004000005 = single
50000000000000000000002000004000004000004000004000005 = married
37500000000000000000002000004000004000004000004000005 = head of household

Previous 26-byte:
*c@_j270588 6shS,6ca0tQE20

Test suite.

25000 = single
50000 = married
37500 = head of household

OP has updated to specify "single digit numbers only"

TI-Basic, 34 32 bytes
Variable F is filing status where 2 = single, 3 = head of household, and 4 = married. Also, E is the scientific E.
Prompt I,F:4I/F>E5{.5,1,3:.1Isum(Ans{1,1,.5

Explanation:
Prompt I,F          get input into I and F
4I/F               converts the income so it fits the married tax bracket
    >E5{.5,1,3     gives a list like {0 0 0}, {1 0 0}, {1 1 0}, or {1 1 1} based on bracket
   sum(Ans{1,1,.5  Multiplies previous list by {1 1 .5} and sums it
.1I                Previous number is 0 1 2 or 2.5, so multiply by .1 and then by income

I'm not horribly familiar with TI-Basic, but would newlines instead of colons save bytes, or just displayable characters?

Which TI-Basic? 83? 84? Nspire?

what is the scientific E?

@LeifWillerts http://tibasicdev.wikidot.com/e-ten

duh, of course!

JavaScript (ES6), 52 bytes
(i,m,g=b=>i>b&&(i-=b)/10)=>g(m=15e4/m)+g(m)+g(m*4)/2

Key:
6 = Single
3 = Married
4 = Head

Stax, 24 bytes
ï¥Ωü+àqGZvwJ╫BMwbë↕)bÿ╠»

Run and debug it
\begin{align}\text{Single}&\mapsto 2\\
\text{Married}&\mapsto4\\
\text{Head of Household}&\mapsto3
\end{align}
Outputs a fraction.


text:
Needs more jQuery!
Inspired by this site, this question could potentially be a doozie. People on StackOverflow often overuse jQuery as an answer. Therefore, we need a way to recognize programmatically if a code snippet uses jQuery.
Given a string (which may or may not contain new lines,) of valid Javascript, determine if jQuery is used.
You determine if jQuery is used if the $ or jQuery functions are called.
Input quirks:

Input will always be valid Javascript.
Input can contain new lines.
Input can omit a semicolon where it would automatically be inserted
There will always be only one argument to the jQuery function.
Dollar signs could exist elsewhere (strings, comments) so be careful.
No base64 conversion functions will/can be used in input.
No eval will/can be used in input.
Any referenced variable or function can be assumed to be defined, but will be guaranteed not to produce errors.
Code snippets will always produce either a truthy or a falsey value, there will be no ambiguous code.
Comments can exist in either form.

Rules:

No Standard Loopholes
This is code-golf, the shortest answer wins.
You must write a program or a function that takes a string as input and returns a truthy value if it uses jQuery, and a falsey value if it does not.
If someone can provide a valid input that breaks your code or causes it to return an incorrect value, it is not a winning answer.

Example Test cases:
include, but are not limited to:
$('div') // true

console.log("$5.99"); // false

$ += 3; // false, the `$` variable clearly has a different value type here

var a = "span" /* this is a comment */
$(a).each(function(){
 jQuery(this);
}); // true

Good luck, and remember, everything's better with a little extra jQuery!

So if I understand this right, if(0){ $('div') } returns false since the $ function is never actually called?

Also, may we assume that every program halts? (i.e. no while(1); $('div'))

Just to clarify, we don't have to handle things like $.get(), right?

Note that we discourage bonuses in code golf challenges

jrich, that is correct, and you may assume that programs halt. Maltysen, you do not have to handle a scenario where the jQuery function is not directly called. Alex, noted, removing bonuses.

What should I add to make this question more clear?

Will all programs be deterministic? I don't think we can reasonably be expected to handle something like if(Math.random() < 0.5) $('div')

"Code snippets will always produce either a truthy or a falsey value, there will be no ambiguous code."

If I'm correctly understanding your answers to jrich, you're requiring answers to solve the halting problem.

@PeterTaylor It means that you won't have to solve the halting problem; all programs given will halt.

@LegionMammal978, "that is correct seems to be the reply to "if(0) { $('div') } returns false". By replacing 0 with a more complex condition you can make it require solving the halting problem.

@LegionMammal978, ok, so pick a non-trivial problem, diagonalise it, and use $ only if the solution found is even. Assuming that it finds a solution doesn't give you enough information.

@Legion understand, this is asking me to write a program which evaluates the result of arbitrary JS code, or perhaps parses it into an abstract syntax tree and decides what the outcome will be. This rather requires a) JavaScript or a language written in JS or b) C++ with libjavascript.

@LegionMammal978 Bah, humbug. Closed as off-topic -- questions asking us to find or recommend a book, tool or software library are off-topic on PPCG :D

Javascript - 52 byte * .9 * .8 = 37.44
Don't know how valid this is, because it redefines $ and jQuery and evals the input to check if it was called.
(x)=>{$=jQuery=()=>alert(1)&3();eval(x+";alert(0)")}

Fails for input alert=0.

@Dennis ....... :/


text:
Discrete Convolution or Polynomial Multiplication
Given two non empty lists of integers, your submission should calculate and return the discrete convolution of the two. Interestingly, if you consider the list elements as coefficients of polynomials, the convolution of the two lists represents the coefficients of the product of the two polynomials.
Definition
Given the lists A=[a(0),a(1),a(2),...,a(n)] and B=[b(0),b(1),b(2),...,b(m)] (setting a(k)=0 for k<0 and k>n and b(k)=0 for k<0 and k>m) then the convolution of the two is defined as A*B=[c(0),c(1),...,c(m+n)] where c(k) = sum [ a(x)*b(y) for all integers x y such that x+y=k]
Rules

Any convenient input and output formatting for your language is allowed.
Built-ins for convolution, creating convolution matrices, correlation and polynomial multiplication are not allowed.

Examples
[1,1]*[1] = [1,1]
[1,1]*[1,1] = [1,2,1]
[1,1]*[1,2,1] = [1,3,3,1]
[1,1]*[1,3,3,1] = [1,4,6,4,1]
[1,1]*[1,4,6,4,1] = [1,5,10,10,5,1]

[1,-1]*[1,1,1,1,1] = [1,0,0,0,0,-1]
[80085,1337]*[-24319,406] = [-1947587115,7,542822]

The specification implies that inputs of length n, m should produce an output of length n + m − 1, but this does not hold for your test case [1,1]*[] = [], and cannot possibly hold for []*[] = ?. Convolution is not well-defined on empty lists. I think you should guarantee that the input lists are nonempty.

@AndersKaseorg You are right, I'll change that.

related: http://codegolf.stackexchange.com/q/67289/29325

J, 10 8 bytes
[:+//.*/

Usage:
ppc =: [:+//.*/    NB. polynomial product coefficients
80085 1337 ppc _24319 406
_1947587115 7 542822

Description: The program takes takes two lists, makes a multiplication table, then adds the numbers on the positive diagonals.

Very clever approach!

You don't need to count the parentheses. The expression inside them evaluates to a tacit verb, which can be assigned to a variable.

Great example of adverbs!

MATL, 19 bytes
PiYdt"TF2&YStpsw]xx

Try it online!
Explanation
This builds a block-diagonal matrix with the two inputs, reversing the first. For example, with inputs [1 4 3 5], [1 3 2] the matrix is
[ 5 3 4 1 0 0 0
  0 0 0 0 1 3 2 ]

Each entry of the convolution is obtained by shifting the first row one position to the right, computing the product of each column, and summing all results.
In principle, the shifting should be done padding with zeros from the left. Equivalently, circular shifting can be used, because the matrix contains zeros at the appropriate entries.
For example, the first result is obtained from the shifted matrix
[ 0 5 3 4 1 0 0
  0 0 0 0 1 3 2 ]

and is thus 1*1 == 1. The second is obtained from
[ 0 0 5 3 4 1 0
  0 0 0 0 1 3 2 ]

and is thus 4*1+1*3 == 7, etc. This must be done m+n-1 times, where m and n are the input lengths. The code uses a loop with m+n iterations (which saves some bytes) and discards the last result.
P          % Take first input (numeric vactor) implicitly and reverse it
i          % Take second input (numeric vactor)
Yd         % Build diagonal matrix with the two vectors
t          % Duplicate
"          % For each column of the matrix
  TF2&YS   %   Circularly shift first row 1 step to the right
  t        %   Duplicate
  p        %   Product of each column
  s        %   Sum all those products
  w        %   Swap top two elements in stack. The shifted matrix is left on top
]          % End for
xx         % Delete matrix and last result. Implicitly display

Haskell, 55 49 bytes
(a:b)#c=zipWith(+)(0:b#c)$map(a*)c++[]#b
_#c=0<$c

Defines an operator #.

I think the padding [0,0..] can be (0<$b) to give exactly the needed length, allowing the empty base case _#b=0<$b.

@xnor Indeed, that saves 6 bytes.

Now that I finally understand your answer, I have to say that this is just so damn clever! I'm impressed!

05AB1E, 18 17 bytes
Code
0Ev²¹g<Å0«y*NFÁ}+

Explanation
The theory behind:
To find the convolution, let's take the example [1, 2, 3], [3, 4, 5]. We position the values of the first array upside down and vertically, like this:
3
2
1

Now, we place the second array like a ladder and multiply it by :
3 ×       [3  4  5]
2 ×    [3  4  5]
1 × [3  4  5]

Resulting into:
        9   12   15
    6   8   10
3   4   5

Then, we add them up, resulting into:
        9   12   15
    6   8   10
3   4   5

3   10  22  22   15

So, the convolution is [3, 10, 22, 22, 15].
The code itself:
We are going to do this step by step using the [1, 2, 3], [3, 4, 5] as the test case.
0Ev²¹g<Å0«y*NFÁ}+

We first push 0 and then we Evaluate the first input array. We map over each element using v.
So, for each element, we push the second array with ² and then the length of the first array using ¹g and decrease this by 1 (with <). We convert this into a list of zeros with (length 1st array - 1) zeros, using Å0 and append this to our list. Our stack now looks like this for the first item in the input list:
[3, 4, 5, 0, 0]

We multiply this array with the current item, done with y*. After that, we push N, which indicates the index of the current item (zero-indexed) and rotate the array that many times to the right using FÁ}. Finally, we add this to our initial value (0). So, what basically is done is the following:
[0, 0, 9, 12, 15] +
[0, 6, 8, 10, 0] +
[3, 4, 5, 0, 0] =

[3, 10, 22, 22, 15]

Which is then implicitly printed. Uses CP-1252 encoding. Try it online!.

Octave, 48 bytes
@(p,q)ifft(fft([p q*0]).*fft([q p*0]))(1:end-1)

Try it here.
Explanation
Discrete convolution corresponds to multiplication of the (discrete-time) Fourier transforms. So one way to multiply the polynomials would be transform them, multiply the transformed sequences, and transform back.
If the discrete Fourier transform (DFT) is used instead of the Fourier transform, the result is the circular convolution of the original sequences of polynomial coefficients. The code follows this route. To make circular convolution equal to standard convolution, the sequences are zero-padded and the result is trimmed.

Damnit, I still sould have banned fft, but good job!

@flawr Yes, I think we talked about that...? :-P

Matlab / Octave, 41 bytes
@(p,q)poly([roots(p);roots(q)])*p(1)*q(1)

This defines an anonymous function. To call it, assign it to a variable or use ans.
Try it here.
Explanation
This exploits the facts that

The (possibly repeated) roots characterize a polynomial up to its leading coefficient.
The product of two polynomials has the roots of both.

The code computes the roots of the two polynomials (function roots) and concatenates them into a column array. From that it obtains the coefficients of the product polynomial with a leading 1 (function poly). Finally the result is multiplied by the leading coefficients of the two polynomials.

Jelly, 9 bytes
0;+
×'Ṛç/

Try it online! or verify all test cases.
How it works
×'Ṛç/  Main link. Arguments: p, q (lists)

×'     Spawned multiplication; multiply each item of p with each item of q.
  Ṛ    Reverse the rows of the result.
   ç/  Reduce the rows by the helper link.

0;+    Helper link. Arguments: p, q (lists)

0;     Prepend a 0 to p.
  +    Perform vectorized addition of the result and q.

What‽ Jelly longer than J‽ That's impossible by definition!

Husk, 5 bytes
mΣ∂Ṫ*

Try it online!
Note: When supplying the zero-polynomial/empty list, you need to specify its type (ie. []:LN)!
Explanation
mΣ∂Ṫ*  -- implicit inputs xs ys, for example: [1,-1] [1,1]
   Ṫ*  -- compute the outer product xsᵀ·ys: [[1,1],[-1,-1]]
  ∂    -- diagonals: [[1],[1,-1],[-1]]
mΣ     -- map sum: [1,0,1]

Matlab, 33 bytes
@(x,y)sum(spdiags(flip(x').*y),1)

Try it online!
Creates a matrix of all element-wise products of the inputs, then sums along the diagonals.
The ,1 at the end forces matlab to sum along the correct direction when one of the input vectors has length 1.
In Octave spdiags does not work for vectors, resulting in an error when one of the inputs has length 1. Matlab 2016b or newer is required for the explicit expansion of the element-wise product.

Nice approach!!

Itr, 6 bytes
##C*µS
reads two lists from standard input, returns a list
online interpreter
Explanation
##     ; read two lists from standard input
  C    ; go through all diagonals of the Cartesian product
   *   ; multiplying the elements from the two lists
    µS ; sum up the diagonals
       ; implicit output

Ruby, 83 bytes
Almost directly pulled out of an answer I did earlier regarding expanding roots into a polynomial.
->a,b{q=a.map{|c|r=b.map{|e|e*c};b=[0]+b;r}
q.pop.zip(*q).map{|e|(e-[p]).reduce:+}}

Python, 90 bytes
lambda p,q:[sum((p+k*[0])[i]*(q+k*[0])[k-i]for i in range(k+1))for k in range(len(p+q)-1)]

JavaScript (ES6), 64 bytes
(a,b)=>a.map((n,i)=>b.map((m,j)=>r[j+=i]=m*n+(r[j]||0)),r=[])&&r

Returns the empty array if either input is empty. Based on my answer to Polynomialception.

56 preserving call method

Julia, 62 55 bytes
~=endof
p%q=[sum(diag(p*rot180(q'),-k))for k=1-~q:~p-1]

Try it online!

Clojure, 104 bytes
#(vals(apply merge-with +(sorted-map)(for[i(range(count %))j(range(count %2))]{(+ i j)(*(% i)(%2 j))})))

Merging to sorted-map guarantees that values are returned in the correct order. I wish there were a few more test cases.

Mathematica, 28 bytes
Definitely, Mathematica has built-in for LinearConvolution (like Polynomial Multiplication) of 2 length-limited lists.
Try it online!
ListConvolve[#,#2,{1,-1},0]&