text:
Is it a leap year?
This challenge is quite simple. You will take an input which will be a year from 1801 to 2400, and output if it is a leap year or not.
Your input will have no newlines or trailing spaces:
1954

You will output in any way that you like that clearly tells the user if it is or isn't a leap year (I will accept y or n for yes/no)
You can get a list of leap years here: http://kalender-365.de/leap-years.php
I would note that leap years are not ever four years always. 1896 is a leap year, but 1900 is not. The years that follow this "skip" are:
1900
2100
2200
2300

Test cases:
1936 ->  y
1805 ->  n
1900 ->  n
2272 ->  y
2400 ->  y

EDIT: This is based on a standard Gregorian calendar: http://www.epochconverter.com/date-and-time/daynumbers-by-year.php
The Catalogue
The Stack Snippet at the bottom of this post generates the catalogue 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:
## [><>](https://esolangs.org/wiki/Fish), 121 bytes

/* Configuration */

var QUESTION_ID = 50798; // 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 = 8478; // 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,<]*(?:<(?:[^\n>]*>[^\n<]*<\/[^\n>]*>)[^\n,<]*)*),.*?(\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,
      });
    else console.log(body);
  });

  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;
    lang = jQuery(''+lang+'').text();

    languages[lang] = languages[lang] || {lang: a.language, lang_raw: lang, user: a.user, size: a.size, link: a.link};
  });

  var langs = [];
  for (var lang in languages)
    if (languages.hasOwnProperty(lang))
      langs.push(languages[lang]);

  langs.sort(function (a, b) {
    if (a.lang_raw.toLowerCase() > b.lang_raw.toLowerCase()) return 1;
    if (a.lang_raw.toLowerCase() < b.lang_raw.toLowerCase()) 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;
  display: block !important;
}

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

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

table thead {
  font-weight: bold;
}

table td {
  padding: 5px;
}

<link rel="stylesheet" type="text/css" href="https://cdn.sstatic.net/Sites/codegolf/all.css?v=ffb5d0584c5f">

Shortest Solution by Language

Language	User	Score

Leaderboard

	Author	Language	Size

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

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

You should be more clear: A given year is a leap year if and only if it is (divisible by 4)∧((divisible by 100)→(divisible by 400)).

Your input will have no newlines or trailing spaces. Dang it, that would have saved me 2 bytes...

You should extend the accepted input range to AD 1601 thru 2400. This covers two 400-year Gregorian cycles (which proleptically start on Monday).

Does falsy if leap year and truthy if not a leap year count as "clearly tells the user if it is or isn't"?

@lirtosiast I think so. A lot of user assume so.

APL, 16 14 12 characters
Returns 0 for a leap year, 1 for a non-leap year.
≥/⌽×4 25 4⊤⎕

Try this solution on tryapl.org. Note that I have changed the solution to the dfn {≥/⌽×4 25 4⊤⍵} as tryapl.com does not support ⎕ (take user input). Note that ⎕ is an empty box, not a missing character.
The same solution in J:
4 25 4>:/@|.@:*@#:]

Explanation
Dyadic ⊤ (encode) represents its right argument in the base specified by its left argument. I use base 4 25 4 in this solution. This represents the year y as a polynomial

y mod 400 = 100 a + 4 b + c where b < 100 and c < 4.

Let propositions α, β, and γ represent if a, b, and c are non-zero: Proposition γ is false if y is dividable by 4, β ∧ γ is false if y is dividable by 100 and α ∧ β ∧ γ  is false if y is dividable by 400.
A truth table (* representing “don't care”) were proposition Δ represents if y is a leap-year obtains:
α β γ | Δ
0 0 0 | 1
1 0 0 | 0
* 1 0 | 1
* * 1 | 0

The following statement expresses Δ in α, β, and γ:

Δ = ¬((α → β) → γ)).

Due to the structure of this statement, one can express ¬Δ as the reduction ≥/⌽α β γ where ≥ implements ←. This leads to the answer I am explaining right now.

Javascript (ES6), 21 characters
The standard rule is that y is a leap year if 4 divides y and if either 100 doesn't divide y or 400 does divide y. In code,
y%4 == 0 && (y%100 != 0 || y%400 == 0)

There's no need for that 100 and 400. Instead it suffices to check whether 16 or 4 divides y, with 16 chosen if 25 divides y, 4 otherwise. Golfed, this becomes
!(y%(y%25?4:16))

A javascript function that implements this is 21 characters long:
l=y=>!(y%(y%25?4:16))

Perl, 28 26 characters
Same idea, but in perl.
$_=$_%($_%25?4:16)?"n":"y"

Run using the -lp options. For example,
perl -lpe '$_=$_%($_%25?4:16)?"n":"y"'

With the test set as input, this produces
1936
y
1805
n
1900
n
2272
y
2400
y

I had used your suggestion in my answer, did not see yours. Now I have rolled back. Note: You should specify EcmaScript 6, or else someone will complain 'not working in Chrome'

@edc65: Well, he should specify EcmaScript 6 because it is EcmaScript 6. Arrow function notation (y=>...) is an ES6 feature.

Shouldn't this be two answers?

-1 byte: l=y=>y%(y%25?4:16)<1

Save 2 bytes for Perl: Try it online!

Pyth, 11 bytes
!%|F_jQ*TT4

This full program read from STDIN and prints True for leap years and False otherwise.
Thanks to @Jakube for suggesting Pyth and basically porting my CJam code.
Verify the test cases yourself in the Pyth Compiler/Executor.
How it works
     jQ*TT   Returns the evaluated input in base 10 × 10.
  |F_        Swaps the digit order and reduces using logical OR.
             So far, we've achieved 1954 -> [19, 54] -> 54 || 19.
!%        4  Returns the logical NOT of the result modulo 4.
             This prints True for multiples of 4 and False otherwise.

CJam, 12 bytes
rS+2m<~e|4%!

This full program read from STDIN and prints 1 for leap years and 0 otherwise.
Verify the test cases yourself in the CJam interpreter.
How it works
r   e# Read from STDIN.
S+  e# Append a space.
2m< e# Rotate two characters to the left.
~   e# Evaluate.
    e# So far, we achieved "1954" -> "54 19" -> 54 19.
e|  e# Logical OR; keep the leftmost non-zero integer.
4%! e# Logical NOT of the kept integer modulo 4.
    e# This pushes 1 for multiples of 4 and 0 otherwise.

I've got a few more 12 byte alternatives. Maybe you can find something in them to bring it down to 11? r2/~~\e|i4%!, r2/~~\~e|4%!, r2/:~~\e|4%!, r2/S*~\e|4%! and the 13 byte r2/:~W%:e|4%!

@MartinBüttner: There's also r2/:i:\e|4%! (12) and r2/:i(fe|~4%! (13). I've even tried GolfScript (which doesn't require r), but or4 is interpreted as a single token. If only the input had a trailing newline...

TI-BASIC, 20 17 16 13
Because it is tokenized, TI-BASIC is often competitive at simple math challenges, but not this one since there is no "divisible" command. Maybe it is after all, but this is still longer than CJam and Pyth.
This uses David Hammond's method.
not(fPart(Ans/4/4^not(fPart(sub(Ans

Old code at 16 bytes:
not(fPart(Ans/16not(fPart(sub(Ansnot(fPart(Ans/4

Ungolfed:
not(fPart(Ans/16) and not(fPart(Ans/100) and not(fPart(Ans/4))))

fPart( is "fractional part"; exponentiation has higher precedence than division. In TI-BASIC, close-parens are optional.
I use undocumented behavior of the sub( command, usually used to get a substring: when its argument is a number instead of a string, it divides the number by 100. It will work on a TI-83 or 84 series calculator.
20 -> 17 by rearranging code to allow removal of close-parens; 17 -> 16 by replacing 400 with 16; 16 -> 13 by using David Hammond's idea.

Pyth, 19 15 14 bytes
xFm!%Q^d2[2TyT

Way too easy. Try it online: Demonstration or Test harness
edit: Missed, that you can print Truthy/Falsy values, instead of n/y. -4 byte
edit 2: Used the square root idea of Martin. -1 byte
Explanation
                 implicit: Q = input number
         [         generate a list with the numbers:
          2          2
           T         10
            yT       2*10 = 20
  m              map each number d to:
   !%Q^d2          not(Q mod d^2) // True if Q % d^2 == 0 otherwise False
xF               fold by xor

Regex, 83 62 38
Thanks to Toby for tips about combining both halves of the regex.
If we focus on 1801..2400 range only and assume input are integers:
(?!00)([02468][048]|[13579][26])(00)?$

Test in Ruby (^ = \A and $ = \Z because Ruby) for the desired range:
r = /(?!00)([02468][048]|[13579][26])(00)?\Z/
(1801..2401).each do |year|
  leap = year % 4 == 0 && ((year % 100 != 0) || (year % 400 == 0))
  leap_regex = !year.to_s[r].nil?
  if leap != leap_regex
    print 'Assertion broken:', year, " ", leap, " ", leap_regex, "\n"
  end
end

(Bonus) for something that should work not only for 1801..2400, but for any non-negative year:
^\d*(0000|(?!00)([13579][26]|(^|[02468])[048])(00)?)$

Test in Ruby (^ = \A and $ = \Z because Ruby) for first 100000 years:
r = /\A\d*(0000|(?!00)([13579][26]|(\A|[02468])[048])(00)?)\Z/
100000.times do |year|
  leap = year % 4 == 0 && ((year % 100 != 0) || (year % 400 == 0))
  leap_regex = !year.to_s[r].nil?
  if leap != leap_regex
    print 'Assertion broken:', year, " ", leap, " ", leap_regex, "\n"
  end
end

If you have (?!) you can combine the two halves: (?!00)([02468][048]|[13579][26])(00)?$ - for 38.  That won't work for one-digit years, though.

Stackylogic, 226 bytes
Yes, that is right. I made a program in Stackylogic (non-TC), which was invented by Helka Homba, for the challenge found here.
Stackylogic has only binary input, so 10 (or more, any more digits will be ignored) bit binary must be used (least significant bit inputted first). Any dates outside the specified range might fail, as it simply checks what the inputted number is: it doesn't cover unnecessary dates
Not only is this my first challenge with stackylogic, but the first challenge with stackylogic at all.
Get ready for this mess:
1
0
1?
010
1?0
010
1?10
?1010
001010
?1010
?1010
?010
?10
?0
0
?
110
?10
11010
?010
11010
?1010
001010
?1010
?1010
?1010
?1010
?010
?0
110
?10
11010
?010
1010
01010
01010
?010
?0
110
?0
110
?0
110
1?0
?10
0?10
?10
?0
01
?
?<
0

This took me so long to make, because Stackylogic is the most confusing language I have encountered, and extremely unreadable: you have to know how the rest of the program has executed before you can read the current section being edited. I even had to add spaces for readability while creating it.
Meagre explanation
This is a simple explanation of what it does.
Stackylogic does not have any mathematical functions, so that made this harder. I had to hardcode most of it, to check if it was a specific number.
First, this program will do a NOR of the least significant bits, discarding them in the process. this means that if it is divisible by 4, it will proceed to the main part of the program, otherwise output 0.
Second, the pointer is carried over to the labyrinth of stackylogic, from here, if the next two bits are zero, it will instantly output 1 (as then it is divisible by 16, and so a leap year despite any other conditions), other wise it will check if it is not any of the numbers that is divisible by 4 but not a leap year, between 1801 and 2400.
To explain in detail, would involve making this post many times longer than it already is

Haskell, 19 bytes
f i=gcd 80i>gcd 50i

Try it online!

JavaScript (ES6) 27
The rule: (y%4==0) && (y%100!=0 || y%400==0)
Golfed: !(y%100<1&&y%400||y%4) (mainly using De Morgans's law)
A function implementing the rule:
l=y=>!(y%100<1&&y%400||y%4)

A test (run in Firefox) just to be sure:

l=y=>!(y%100<1&&y%400||y%4)

for(o=[],i=0;i<700;i++)
  y=i+1800,
  x=l(y),
  o[i/100|0]=(o[i/100|0]||'')+y+(x?' Y':' N')+'\n'

R.innerHTML=''+o.join('	')+'	'
console.log(o[1])
td { white-space: pre; font-family: monospace; padding: 8px}

b { color: red; }
i { color: blue; }

You can reduce this by six characters if you use !(y%(y%25?4:16)) instead of !(y%100<1&&y%400||y%4). For those bothered by the ternary operator, you could use !(y%(4<<2*!(y%25))) and still save three characters over   !(y%100<1&&y%400||y%4).

David Hammen's suggestion is identical to his answer, so I think you should keep the length as 27.

Pip, 13 bytes
This one was more interesting than it at first appeared. It took some finagling, but I was finally able to replace those lengthy references to 400 with 4 and the h variable (=100).
!(a%h?aa/h)%4

Outputs 1 for leap year, 0 for non-leap year.  Explanation:
               a is command-line argument (implicit)
  a%h?aa/h     If a is divisible by 100, divide it by 100; otherwise, leave it alone
 (        )%4  The result mod 4 is 0 if it's a leap year, nonzero otherwise
!              Negate and (implicitly) print

IBM System Z assembler - 56 bytes.
(96 bytes of source. Previously 712 384 202 bytes of source, 168 byte executable).
Smaller version still. No longer saves caller's registers, changes to literal storage, changed addressing mode.
 l        CSECT
         using l,15
         l  5,y
         n 5,f
         bnz r
         xr 4,4
         l 5,y
         d 4,c
         ch 4,i
         bne i
         n 5,f
         bnz r
i        dc h'0'
r        b  *
y        dc f'2004'
f        dc f'3'
c        dc f'100'
         end

New version. This will ABEND with a S0C1 if it's a leap year, and loop if it isn't. Hopefully that fulfils the requirement of indicating the result.
l        CSECT
         ASMDREG
         SYSSTATE archlvl=2
         IEABRCX  DEFINE
         save  (14,12)
         larl  r9,s
         using s,r9
         st 13,w+4
         la 13,w
         st 13,w+8
         la 5,2004
         st 5,y
         n 5,=f'3'
         bnz r
         xr r4,r4
         l 5,y
         d r4,=f'100'
         ch r4,=h'0'
         bne i
         n 5,=f'3'
         bnz r
i        dc h'0'
r        b  0
s        dc 0d'0'
y        ds f
w        ds 18f
         ltorg
         end

OK, so not the shortest (although it might be once we look at the actual executed code plus the interpreter size...)
leapyear CSECT
         ASMDREG
         SYSSTATE archlvl=2
         IEABRCX  DEFINE

         save  (14,12)

         larl  r9,staticArea
         using staticArea,r9
         st r13,w_savea+4       .Save callers savearea
         la r13,w_savea         .Address my savearea
         st r13,w_savea+8         . and save it

         open  (O,OUTPUT)             .open file

         la r5,1936             .r5 = input year
         st r5,years            .Save year

         cvd r5,double          .Convert year to p-decimal
         mvc edarea,=xl8'4020202020202120' .Move in edit mask
         ed edarea,double+4      .Make packed decimal year printable
         mvc outrec(4),edarea+4  .Move year string to output area
         bas r10,isitleap       .Call leap year routine

         close (O)              .Close files
         b return               .Branch to finish

isitleap ds 0h
         mvi outrec+5,c'N'      .Set default value
         n r5,=f'3'             .Are last 2 bits 0 (Divisible by 4)?
         bnz notleap            .No - not leap
         xr r4,r4               .Clear R4
         l r5,years             .Reload r5 with year
         d r4,=f'100'           .divide r4/r5 pair by 100
         ch r4,=h'0'            .Remainder 0?
         bne isleap             .No - leap year
         n r5,=f'3'             .Quotient divisible by 4?
         bnz notleap            .No - not leap

isleap   ds    0h
         mvi outrec+5,c'Y'      .Move in leap year indicator

notleap  ds    0h
         put O,outrec           .Print output record
         br r10                 .Return to caller

* Program termination
return   ds 0h
         l r13,w_savea+4         .Restore callers savearea
         return (14,12),,rc=0    .Restore registers and return
* storage areas
staticarea  dc 0d'0'
outrec      ds cl10
years       ds f
w_savea     ds 18f                save area
edarea      ds cl8                    .edit area
double      ds d
* Macros and literals
         print nogen
O        dcb   recfm=F,lrecl=6,dsorg=PS,ddname=O,macrf=PM
         print gen
*
         ltorg                         literal storage
         end

Output:
ABEND S0C1 for a leap year, S222 (when the CPU time has run out) if not.
1936 Y
    1805 N
    1900 N
    2272 Y
    2400 Y
(when run multiple times)

Down to 376 bytes by making storage areas minimum size (13 bytes), removing staging area 'leapflag' and only including a single year (rather than 5) in the program.

384 bytes by providing a slightly formatted output:

+1 for interesting and educational choice of language.  :-)

I could save a few bytes by abandoning convention and not bothering to save the callers registers at the start, seeing as the program never returns to the caller. This is Very Bad Form.

CJam, 18 16 bytes
q~[YAK]f{2#%!}:^

Gives 1 (truthy) for leap years and 0 (falsy) otherwise.
Run all test cases here.
Explanation
q~                 e# Read and eval input.
  [YAK]            e# Push an array containing 2, 10, 20 (the square roots of the
                   e# relevant divisors).
       f{    }     e# Map this block onto that array, also passing in the input year.
         2#        e# Square the divisor.
           %!      e# Modulo followed by logical negation. Gives 1 if the year is divisible
                   e# by the given divisor and 0 otherwise.
                   e# At this point we have one of the following arrays:
                   e#   [0 0 0] - not a leap year
                   e#   [1 0 0] - a leap year
                   e#   [1 1 0] - not a leap year
                   e#   [1 1 1] - a leap year
              :^   e# Reduce XOR onto this array, which gives 1 if there is an odd number
                   e# of 1s and 0 if there's an even number.

R, 29
!(Y=scan())%%4&Y%%100|!Y%%400

Test run
> !(Y=scan())%%4&Y%%100|!Y%%400
1: 1936
2: 1805
3: 1900
4: 2272
5: 2400
6: 2200
7:
Read 6 items
[1]  TRUE FALSE FALSE  TRUE  TRUE FALSE

Mathematica, 40 27 bytes, 17 chars
#∣4∧(#∣100#∣400)

Uses 17 chars, but 27 bytes. Thanks to @alephalpha for the tip. Note that the vertical bars are actually U+2223 for divides. The  should be replaced with the corresponding character.

This is one of those puzzles where Mathematica offers a solution that feels kind of cheaty: LeapYearQ[#]&

You can use ∣ to represent Divisible : #∣4&&(!#∣100||#∣400)&, 21 characters, 27 UTF-8 bytes.

@zeldredge Still, that's not shorter than the APL solution.

@alephalpha Alternatively, you could use U+F523 (\[Implies]) to make it #∣4&&(#∣100#∣400)& for 19 chars (but still 27 bytes).

This is a standard loophole; you're using a function that does exactly the required functionality. This is verboten.

@FUZxxl Thanks, it's been a long time since I've read them.

sed, 55
s/00$//
y/0123456789/yNnNyNnNyN/
/N.$/y/ny/yn/
s/.\B//g

First line divides exact centuries by 100.
Second line gives 'N' to odd digits, 'y' to 4s, and 'n' to non-4s.
Third line swaps 'y' and 'n' if there's an odd penultimate digit (because 10 is 2 mod 4)
Final line deletes all but the last character

Note that non-leap years may be printed as n or N depending on whether they are even or odd.  I consider this a creative interpretation of the rule which allows alternatives to 'yes' and 'no' without specifying that they have to be consistent.

Extremely clever! tio your code

C, 81
I can do shorter, but this one neatly sticks to 'char' types, without parsing the argument (e.g. with atoi):
main(c,v)char**v;{char*p=*v+9;p-=2*(96==*p+p[1]);putchar("ynnn"[(2**p^p[1])&3]);}

It must be invoked with a name 4 characters long, because it makes the standard assumption that arguments immediately follow the program name, separated by NULs.  Furthermore, it assumes that the single argument is encoded in ASCII and has no leading space.
Explanation:
main(c,v)
char**v;
{
    char *p = *v+9;
    if (p[0] + p[1] == '0'+'0')
        p -= 2;
    putchar("ynnn"[((*p << 1) ^ p[1])&3]);
}

*v+9 is the position of the 'tens' digit in v[1]+2.
If the 'tens' and 'units' characters add to 96, we end in 00, so back up two characters, so that 'tens' and 'units' point to the century number.
Now xor 'units' with twice the 'tens', mod 4.  This works because 10==±2 mod 4, so the lower bit of the 'tens' can just toggle bit 1 of the 'units'.  We use the result as an index into our remainders table, printing y only if the modular result is zero.

Julia, 30 28 bytes
y->(y%4<1&&y%100>0)||y%400<1

This creates an unnamed function that accepts an integer argument and returns a boolean value. To call it, give it a name, e.g. f=y->....
Ungolfed:
function f(y)
    (y % 4 == 0 && y % 100 != 0) || y % 400 == 0
end

Example:
julia> for y in [1936, 1805, 1900, 2272, 2400] println(f(y)) end
true
false
false
true
true
true

Python2 - 37 bytes
g=lambda x:(x%4or x%400and x%100<1)<1

Note that if a is a nonnegative integer, then a<1 is a short way of writing not bool(a).  The last <1 thus effectively converts the expression in the parentheses to a boolean and negates the result.
Applying the function g to an integer n between 1801 and 2400 will return True if n is a leap year, and False otherwise.

Jelly, 7 bytes
ọ4,25>/

Try it online!
How it works
ọ4,25>/  Main link. Argument: n (1801 - 2400)

ọ4,25    Test how many times n is divisible by 4 and 25.
     >/  Verify that the order of 4 is higher than the order of 25.

Befunge-98, (41 bytes)
&:4%#v_:aa*%#v_28*%|
"y",;<;@,"n";>;  ;#[

Simplicity is awesome.

C, 37 34 30 bytes
l(y){y=y%(y%25?4:16)?110:121;}

Wandbox

Python, 37 bytes
def c(s):return s%16*(s%25<1)<(s%4<1)

Java 8, 49 45 22 20 bytes
n->n%(n%25<1?16:4)<1

-2 bytes thanks to @OlivierGrégoire.
Try it online.
Some 22 bytes solutions:
n->n%25<1?n%16<1:n%4<1

Try it online.
n->(n%25<1?n%16:n%4)<1

Try it online.
java.time.Year::isLeap

Try it online.
Explanation:
n->                // Method with integer parameter and boolean return-type
   n%          <1  //  Return whether the integer is divisible by:
     (n%25<1?      //   If the input is divisible by 25:
             16    //    Check if its divisible by 16
            :      //   Else:
             4)    //    Check if its divisible by 4 instead

Another 22 bytes alternative: java.time.Year::isLeap.

And a 20 bytes solution: n->n%(n%25<1?16:4)<1

@OlivierGrégoire Nice 20-byter! And didn't realize that the builtin was also 22 bytes. :)

C#, 23 bytes
y=>y%25<1?y%16<1:y%4<1;

Try it online!
Full source, including test cases:
using System;

namespace CountingLeapYears
{
    class Program
    {
        static void Main(string[] args)
        {
            Func<int,bool>s=y=>y%25<1?y%16<1:y%4<1;
            Console.WriteLine(s(1936)); //y
            Console.WriteLine(s(1805)); //n
            Console.WriteLine(s(1900)); //n
            Console.WriteLine(s(2272)); //y
            Console.WriteLine(s(2400)); //y
        }
    }
}

KDB(Q), 27 bytes
{0=x mod(4 400)0=x mod 100}

Explanation
               0=x mod 100      / boolean of 100 divisibility
        (4 400)                 / 0b -> 4, 1b -> 400
 0=x mod                        / boolean of 4/400 divisibility
{                         }     / lambda

Test
q){0=x mod(4 400)0=x mod 100}1936 1805 1900 2272 2400
10011b

PHP - 45 bytes
$b=$argv[1]%400;echo !$b|!($b%4)&!!($b%100);

Nothing that special really, just abusing type-juggling.

T-SQL 37 22 bytes
Saved 15 bytes thanks to BradC's comment.
The usual hardcoded variable for lack of a stdin.
e.g.
DECLARE @ NVARCHAR(4) = '2016'

Then the solution is:
PRINT ISDATE(@+'0229')

If I'm reading the challenge right, I think you can save a bunch of bytes by just returning the 1 or 0 directly: PRINT ISDATE(@+'0229')

05AB1E, 9 7 bytes
т‰0Kθ4Ö

Try it online or verify all test cases.
Explanation:
т‰         # Divmod the (implicit) input by 100
           #  i.e. 1900 → [19,00]
           #  i.e. 1936 → [19,36]
           #  i.e. 1991 → [19,91]
           #  i.e. 2000 → [20,00]
  0K       # Remove all 0s
           #  i.e. [19,00] → [19]
           #  i.e. [19,36] → [19,36]
           #  i.e. [19,91] → [19,91]
           #  i.e. [20,00] → [20]
    θ      # Pop and get the last item
           #  i.e. [19] → 19
           #  i.e. [19,36] → 36
           #  i.e. [19,91] → 91
           #  i.e. [20] → 20
     4Ö    # Check if it's divisible by 4 (and output the result implicitly)
           #  i.e. 19 → 0 (falsey)
           #  i.e. 36 → 1 (truthy)
           #  i.e. 91 → 0 (falsey)
           #  i.e. 20 → 1 (truthy)

Javascript ES6, 32, 29, 26
Any of following lines works:
f=y=>new Date(y,2,0).getDate()&1
g=y=>!(y&3)^!(y%100)>!(y%400)
h=y=>!(y&3|y%100<1&&y%400)

C, 57 bytes
Takes the input from stdin, with or without trailing spaces/newline. Only works on little endian machines (yeah, like everyone is on BE these days). Outputs Y or N.
main(y){scanf("%d",&y);y=y%(y%100?4:400)?78:89;puts(&y);}

Explanation
Ungolfed:
int main(int y) {
   scanf("%d", &y);
   y = y % (y % 100 ? 4 : 400) ? 'N' : 'Y';
   puts(&y);
}

First, scanf reads the year as an integer in y. Then, y is modulo'ed with 4 or 400 depending on whether the year is divisible by 100. If the remainder is zero, the ASCII code for Y is assigned to y, otherwise it gets the ASCII code for N. The value of y is now 0x000000??, where 0x?? is the assigned character. Being on a little-endian machine, in memory this is stored as ?? 00 00 00. This is a NULL-terminated C string, containing only the assigned characters. The address of y is passed to puts and the char is printed (with a trailing newline).

"You will output in any way that you like that clearly tells the user if it is or isn't a leap year." Can you save a couple bytes by returning 1 or 0 rather than 'Y' or 'N'? (I don't really know C at all, just guessing.)

@AlexA. Thanks for the edit - now I know how to highlight syntax :) I considered it. The ASCII codes are both two digits, so no gain from that (by the way, I'm using uppercase Y and N to save 2 bytes, since lowercases have 3 digits). They are sequential, so that could be useful. Unfortunately, due to operator precedence, I get the same byte count: main(y){scanf("%d",&y);y=!(y%(y%100?4:400))+48;puts(&y);}. I can go down to 48 bytes if I can output an empty line for leap years and any character (ASCII 1-99) otherwise, but I feel like it's a bit bending the rules. What do you think?

I must have done something wrong when counting chars. It's 57, not 59 :)

Yeah, I'd say that's bending the rules, but you could comment on the question and ask the OP for confirmation. A good tool for counting bytes is this--I think a lot of the folks here use it.

Nah, I'll leave it as it is :)

Haskell, 43 41 39 bytes
l x=mod x(if mod x 25<1then 16else 4)<1

If x is divisible by 25, check if it is also divisible by 16, making it divisible by the least common multiple of 25 and 16, which is 400.
If x is not divisible by 25, check if it is divisible by 4.
Inspired by @David Hammen's answer in JavaScript.

I don't know Haskell, but can ==0 be <1?

You are right, it can.

You can drop the spaces before then and else.

The conditional can be equivalently expressed as (4+sum[12|mod x 25<1]) for a total of 33 bytes: Try it online!

PHP, 34 30 bytes
echo+!($argn%($argn%25?4:16));

I'm using the + sign to convert false (which would normally be converted to an empty string) to 0, because that seems to comply closer to the "clearness" requirement (maybe not?). With standard truthy/falsy rules, 1 byte can be saved.
Note: I shamelessly implemented the divisibility by 25 trick from @David Hammen. Without his algorithm it would be 37 bytes:
<?=+!(($b=$argv[1])%400^$b%100^$b%4);

Run like this:
echo 1900 | php -nR 'echo+!($argn%($argn%25?4:16));';echo

Tweaks

Saved 4 bytes by using $argn

Save one more byte on standard truthy/falsy with <1 instead of !()

PowerShell, 31 bytes
I am excited to say that I golfed this shorter than the builtin!
param($a)!($a%(4,16)[!($a%25)])

Outputs true for leap years and false otherwise.
Builtin:
[datetime]::IsLeapYear($args[0])

Though, if I wanted to stretch the statement 'clearly tells the user if it is or isn't a leap year' and do something non-standard, I could save 3 bytes and use:
param($a)$a%(4,16)[!($a%25)]

This outputs 0 for leap years and 1 or higher for non-leap years, which I don't like since I'd prefer to return a more standard truthy value for leap years.

LOLCODE, 228 202 159 bytes
HOW IZ I f YR a
MOD OF a AN 100
O RLY?
YA RLY
MOD OF a AN 4
O RLY?
YA RLY
b R 1
OIC
NO WAI
MOD OF a AN 400
O RLY?
YA RLY
b R 0
NO WAI
b R 1
OIC
OIC
IF U SAY SO

Ungolfed:
HAI 1.3 BTW "HAI" does nothing functionally in current versions and does not throw an error if you omit it.
HOW IZ I leap YR input
    I HAS A output
    DIFFRINT MOD OF input AN 100 AN 0 BTW Thanks @LeakyNun, In LOLCODE any non-empty values, i.e. 0, "", etc. default to WIN.
    O RLY?
        YA RLY
            BOTH SAEM MOD OF a AN 4 AN 0
            O RLY?
                YA RLY
                    output R WIN BTW "WIN" is true, but in the actual program I used 1 as a truthy value because it's shorter.
            OIC
        NO WAI
            DIFFRINT MOD OF a AN 400 AN 0
            O RLY?
                YA RLY
                    output R FAIL BTW "Fail" is false, but in the actual program I used 0 as a falsy value.
                NO WAI
                    output R WIN
            OIC
    OIC
    FOUND YR output BTW This statement is implied in the golfed version.
IF U SAY SO BTW "KTHXBYE", just like "HAI" has no functional purpose and throws no error on omission.
KTHXBYE

In Python ungolfed, because LOLCODE is confusing:
def leap:
    if(year % 100 != 0):
        if(year % 4 == 0):
            output = true
    else:
        if(year % 400 != 0):
            output = false
        else:
            output = true
    return(output)

Would it be shorter to define a function?

probably, but I will edit it later.

You have updated the main code to be a function, but not the ungolfed code?

I thought LOLCODE has automatic type coercion, meaning that any non-zero value is equivalent to WIN..

It is, but how could I use that? I don't think I am doing any casting.

Instead of comparing year%400 with 0, you can use it directly

Fixed bytecount that I don't know how was wrong

Mathematica, 15 bytes
LeapYearQ@*List

Mathematica has a built-in for everything. List is there to make the integer input into a compact DateList object. Returns True or False.

LeapYearQ@{#}& for 14

Just LeapYearQ works

PHP, 28 bytes
Why calculate when there´s a builtin?
<?=checkdate(2,29,$argv[1]);

prints 1 for leap year, empty string for no leap year.
Add + after <?= for 1/0.

SmileBASIC, 40 bytes
INPUT Y?0DTREAD STR$(Y)+"/02/29"OUT,,,?1

Prints 0 1 if it's a leap year, otherwise prints 0 and errors.
DTREAD parses a date string in the form of YYYY/MM/DD and gives the year, month, and day. It can also return the day of the week, and trying to get the day of the week of a day that doesn't exist (Feb. 29 of a non-leap year) will cause an error.
This is shorter than the obvious answer using mod, because SB uses MOD instead of %, which takes up 3-5 characters.

x86 machine code, 16 bytes
00000000: fcad fdad 2d30 3074 fa86 c4d5 0aa8 03c3    ...-00t.........

Listing
FC         CLD             ; set direction for LODSW to increment
AD         LODSW           ; SI += 2 to start with last two digits
FD         STD             ; set direction for LODSW to decrement
       LD:
AD         LODSW           ; load two ASCII digit chars into AX
2D 3030    SUB  AX, '00'   ; convert to decimal, test if year ends in 00?
74 FA      JZ   LD         ; if so, look at the first two digits instead
86 C4      XCHG AL, AH     ; endian convert
D5 0A      AAD             ; base convert from 10 to word
A8 03      TEST AL, 3      ; mod 4 = 0?
C3         RET             ; return to caller

Input string in SI, output is ZF if is a leap year.
Explanation
If the year does not end in 00, it is a leap year if last two digits mod 4 is 0.  If it does end in 00, it will be a leap year if the first two digits mod 4 is 0. Example:
Leap year:

1936: 36 mod 4 == 0
2400: 24 mod 4 == 0

NOT leap year:

1805: 05 mod 4 == 1
1900: 19 mod 4 == 3

Test Program Output

Excel, 30 25 bytes
Because of an intentional bug in Excel to maintain compatibility with Lotus 1-2-3  the year 1900 is treated as a leap year. We can however shift the year by 400 before doing the calculation. The leap year bug then occurs in 1500, which we don't care about anyway. For the following formula A1 serves as input.
=DAY(DATE(A1+400,2,29))>1

If you can accept 1 for leap year and and #VALUE!  for other years, you can get this down to 19 bytes:  =("2/29/"&E1+400)^0.

Python 3, 26 bytes
lambda n:n%4**-~(n%25<1)<1

Try it online!
Using Kevin Cruijssen's Java approach.

Python 3, 28 bytes
lambda n:(n%100or n/100)%4<1

Try it online!
Using Kevin Cruijssen's 05AB1E approach.

Ruby, 28 bytes
The lambda takes an Integer y representing the year and returns true or false.
->y{y%4<1&&y%100>0||y%400<1}

Use like this:
f=->y{y%4<1&&y%100>0||y%400<1}
f[2004]
# => true

or this:
f=->y{y%4<1&&y%100>0||y%400<1}
[1936,1805,1900,2272,2400].map(&f)
# => [true, false, false, true, true]

Try it online
Explanation

y%4<1&&y%100>0

Years that are divisible by 4 but not by 100 are leap years, e.g. 2004
Years that are divisible by 4 and also by 100 are not leap years, e.g. 1700

y%400<1

Years that are divisible by 400 are leap years, e.g. 1600

Welcome to Code Golf, and nice answer! According to site rules, you'll need to use a full program or function instead of assuming the input is in y.

Welcome to Code Golf, and nice first answer! Unfortunately, this isn't quite valid as submissions here must be full programs or functions. If you made this a function taking y as an argument, that'd be fine.Also, it helps to provide a TIO link or similar so others can test your code themselves.

@RedwolfPrograms thanks for pointing out, provided function (with additional 9 characters).

I just realized there's a 22 bytes Ruby solution already

Arturo, 5 bytes
leap?

Try it!

SpecBAS - 77
Not the shortest (but not the longest either).
1 INPUT y: PRINT y;"->";"ny"((y MOD 4=0 AND (y MOD 100<>0) OR y MOD 400=0)+1)

Uses the standard formula, then prints "n" or "y" based on return value (the final +1 at the end is due to strings being 1-based).

I don't know the language, but based the fact that there are no booleans, you may be able to save some characters by using something like y MOD (4+12*(y MOD 100=0))=0.

Python, 50 48 bytes
import calendar as y
def a(b):print(y.isleap(b))

C#, 26 bytes
y=>DateTime.IsLeapYear(y);

C# lambda (Predicate) where the input is a int and the output is a bool. I use a builtin.

You don't really need the lambda here, and I would argue the answer is more valid without it.

@VisualMelon In the meta section, they ask for a function. (If I remember)

Aye, but DateTime.IsLeapYear is a function ;) generally the rule is that it has to evaluate to a function if it isn't named, and strictly your current submission is meaningless (join the argument here!), while System.DateTime.IsLeapYear is fully typed (System.Func<int,bool>A=System.DateTime.IsLeapYear compiles fine) without demanding any user inference (or indeed the text in your answer which specifies the input and output types).

BASH, 68 bytes
((!(y % 4) && ( y % 100 || !(y % 400)))) &&  echo "leap" || echo "no"

Retina, 24 bytes
[^04]00$

.+
$*
....

^$

Try it online!

PHP, 45 bytes
<?=date_create($argv[1].'-1-1')->format('L');

Not the shortest, but using built in functions. Totally not code-golf.

Jelly, 8 bytes
ȷ2*ḍ¥×4ḍ

Try it online!

Bash, 14 bytes
date -d$1/2/29

Try it online!
Outputs via exit code, 0 for leap year and 1 otherwise.
date -d STRING will display the date indicated by STRING. $1/2/29 represents February 29th of $1, the argument. If STRING is not valid, i.e. Feb 29 does not exist, then date errors out.

C++, 50 43 bytes
-7 bytes thanks to Zacharý
int l(int y){return!(y%4)&&y%100+!(y%400);}

And the test code is :
auto t = {
    1936,1805,1900,2272,2400
};

for (auto&a : t) {
    std::cout << "Year : " << a << " is " << (l(a) ? "" : "NOT") << " a leap year\n";
}

You can make it int l(int y){return(y%4==0&&y%100)+(y%400==0);} to save a few bytes

I think making +(y%400==0) +!(y%400) might work as well.

int l(int y){return!(y%4)&&y%100+!(y%400);}

Ruby, 22 bytes
->n{1>n%(n%25<1?16:4)}

Try it online!
The challenge is quite old, but I noticed there was no valid Ruby answer yet. Nothing particularly original, anyway.

D, 43 42 bytes
T l(T)(T y){return!(y%4)&&y%100+!(y%400);}

Try it online!
Another port of @HatsuPointerKun's C++ answer.

Kotlin, 30 bytes
{it%4<1&&(it%100>0||it%400>0)}

Try it online!

Japt -!, 8 5 bytes
Locale dependent; in my locale the timezone offset is GMT+0000 for leap years and GMT-0025 for all others.
ÐUT k

Try it or run all test cases
ÐUT k     :Implicit input of integer U
Ð         :Create Date object from (defaulting to the first day of the month)
 U        :  The year U
  T       :  The month 0 (months are 0-indexed in JS)
    k     :Get timezone offset as an absolute integer (0 or 25)
          :Implicit output of logical NOT of result

And here's my original 8-byte solution, which isn't locale dependent and outputs 1 or 0 for true & false:
ÐUT#< Îu

Try it (includes all test cases)
ÐUT#< Îu     :Implicit input of integer U
ÐUT          :As above but ...
   #<        :  With the date set to 60 (dates wrap over to the next month in JS, so this will give us either 29/02 or 01/03)
      Î      :Get 0-based index of month (1 or 2)
       u     :Modulo 2

You can do ÐUT91 Îv to output 1 for leap year and 0 for non-leap year.

@Oliver, yeah, I suppose it would be clearer if I reversed the output. Updated. I came up with a few other similar alternatives, all relying on new Date rolling over.

@Oliver, found a shorter way.

Every test case is returning false for me.

@Oliver, it's locale dependent.

Why would a leap year be locale dependent?

@Oliver, its the timezone offset that's the key; in my locale it's GMT+0000 for leap years and GMT-0025 for other years.

Common Lisp, 46 bytes
(=(mod(setq x(read))(if(>(mod x 25)0)4 16))0)

Try it online!
Based on the David Hammen’s method.

Clam, 33 31 bytes
=a*rp|e%a*"400"0&%a*"100"e%a*40

Try it online!
-2 bytes thanks to ASCII-only
Outputs true for leap years. Outputs false for other years
Explanation
=a*rp|e%a*"400"0&%a*"100"e%a*40
=a*r                             read input and store in a*
    p                            Print..
       %a*"400"                    a* % 400
      e                            ==
               0                   0
     |                             OR
                 %a*"100"            a* % 100
                &                    AND
                          %a*4       a* % 4
                         e           ==
                              0      0

Very awkward explanation, but basically what it does is this:
print(year % 400 == 0 || (year % 100 && year % 4 == 0))

Clam follows JS rules for truthy and falsey values, meaning year % 100 is true if it does not equal 0 (and it's shorter than adding an e before it and an 0 after it)
Resulting JS:
myVar = read();
console.log(year % 400 == 0 || (year % 100 && year % 4 == 0));

ew 8552. use something nicer like 4545 pls

jk, 31

also pls fix your indentation in the explanation :|

fixed that year % 100 thing

MathGolf, 9 bytes
4♀`*]÷~≤*

Try it online!
Explanation
4         Push 4
 ♀        Push 100
  `*      Duplicate top two elements of stack and multiply (400)
    ]     Wrap stack in array ([4, 100, 400])
     ÷    Check input for divisibility with all array items
      ~   Dump array onto stack
       ≤  Check if divisibility by 100 is <= than divisibility with 400
        * Multiply with the divisibility bool for 4, works like logical and

The trick is that ≤ ensures that if a number is divisible by 100, it must also be divisible by 400, but if it's not divisible by 100, anything goes.

Japt -h!, 8 bytes
Input is taken as a string.
k0 ò o%4

Try it online!

Haskell, 35 bytes
l x|x!25<1=x!16<1
l x=x!4<1
(!)=mod

Try it online!

PHP, 35 34 bytes
-1 byte thanks to 640KB
<?=date(L,strtotime($argv[1].-1));

Try it online!
Came across the L option in the PHP date formatter, which returns if the year of the date is a leap year. After that, it was just a matter of trying to get the timestamp of the year in the shortest way (though I'm not too confident this is the shortest)

Well, strtotime($argv[1].-1) is 1 byte shorter at least https://tio.run/##K8go@P/fxt42JbEkVcNHp7ikqCS/JDM3VUMlsSi9LNowVk/XUFPT@v///0ZG5kYA

Reg, 14 bytes
1¿:%[4|]%[;]

Try it online!
How it works (because it contains unprintable characters)

Maybe leave a note as to why you've spelt it Reg when the link goes to Keg, so people like me don't think you've just made a typo.

Okay. We have decided to rename "Unofficial Keg" as "Reg."

W d, 10 8 bytes
Ö♦Ç⌂╬`§Γ

Explanation:
Uncompressed:
25m4&16|m!

25m        % If the input is modulo-able by 25:
   4&      % Return 4
     16|   % Otherwise, return 16
        m! % Modulo input by the value. Negate the value.

Forth (gforth), 48 39 bytes
: f 'd /mod over if d>s then 4 mod 0= ;

Try it online!
Same as Kevin Cruijssen's 05AB1E answer.
-9 bytes from Bubbler.

100 -> 'd, drop -> d>s, and some logic rearrangement gives 39 bytes.

added it to the answer..

Python, 125 bytes
y=int(input(""))
if y%100==0 and y!=2400:
    print("n")
else:
    if y%4==0:
        print("y")
    else:
        print("n")

Try it Online!

Vyxal, 13 10 bytes
-3 bytes Thanks to Kevin Cruijssen
25Ḋ[16|4]Ḋ

Outputs 1 for truthy, 0 for falsy
Try it Online!
Explanation
25Ḋ           - is it divisible by 25?
   [16   Ḋ    - if so: check if its divisible by 16
      |4]Ḋ    - if not: check if its divisible by 4

Vyxal, 7 bytes
A port of Kevin Cruijssen's answer
₁ḋ0ot4Ḋ

Try it Online!
Explanation
₁ḋ       - divmod the input by 100
  0o     - remove all instances of 0 from the result
    t4Ḋ  - grab the tail of the divmod result and check if it's divisible by 4

Vyxal has a divisible builtin Ḋ. :) Also, a port of my 05AB1E answer is 7 bytes.

Pascal, 100 B
This is a complete program according to and requiring a processor complying to ISO standard 7185 “Pascal” (level 0 sufficient).
It demonstrates the importance of sets in Pascal.
Note, + and − are left-associative thus the following is guaranteed to yield the expected result.
program p(input,output);var y:integer;begin read(y);write(0 in[y mod 4]-[y mod 100]+[y mod 400])end.

For the standard non-golfed version using Boolean operators and/or see RosettaCode.
Delphi/Free Pascal, 62 B
The .toInt64 “type helper” requires at least FPC version 3.0.0.
In FPC, {$mode Delphi} or {$mode objFPC} have to be selected so paramStr returns “long strings”.
Evidently, input is specified as the first argument on the command line.
{$mode Delphi}
uses sysUtils;begin write(isLeapYear(paramStr(1).toInt64))end.

This is pretty much the same as the RosettaCode implementation.

Fig, \$11\log_{256}(96)\approx\$ 9.054 bytes
?%25x%4x%16

Try it online!
Port of Vyxal. Outputs 0 for truthy, positive numbers for falsey.
?%25x%4x%16
?%25x       # If mod 25 is > 0
     %4x    # Print mod 4
        %16 # Else print mod 16

-3 chars: %^4}!%25

how does that work exactly?

n % 4^!(n%25)

Go, 47 bytes
func(y int)bool{return y%4<1&&y%100>0||y%400<1}

Attempt This Online!

Thunno 2 t, 6 bytes
ɦḋ0o4Ḋ

Attempt This Online!
Port of Kevin Cruijssen's 05AB1E answer.
Explanation
ɦḋ0o4Ḋ  # Implicit input
ɦḋ      # Divmod by 100
  0o    # Remove 0s
    4Ḋ  # Divisible by 4?
        # Implicit output
        # of last item

MATLAB + Aerospace Toolbox, 9 bytes
@leapyear

Anonymous function that determines if the passed year is a leap year, returning 1 for leap and 0 for not.
Ok so MATLAB has a built-in... But there we are.

Octave, 13 bytes
@is_leap_year

Try it online!
Octave also has a built-in... cost's 4 more bytes than MATLAB though.

Whitespace, 103 bytes
[S S S N
_Push_0][S N
S _Duplicate_0][S N
S _Duplicate_0][T   N
T   T   _Read_STDIN_as_integer][T   T   T   _Retrieve][S N
S _Duplicate_input][S S S T T   S S T   N
_Push_25][T S T T   _Modulo][N
T   S T N
_If_0_jump_to_Label_TRUE][S S S T   S S N
_Push_4][T  S T T   _Modulo][N
T   S S N
_If_0_jump_to_Label_LEAP][N
S N
N
_Jump_to_Label_PRINT][N
S S T   N
_Create_Label_TRUE][S S S T S S S S N
_Push_16][T S T T   _Modulo][N
T   S S N
_If_0_jump_to_Label_LEAP][N
S N
N
_Jump_to_Label_PRINT][N
S S S N
_Create_Label_LEAP][S S S T N
_Push_1][N
S S N
_Create_Label_PRINT][T  N
S T _Print_as_integer]

Letters S (space), T (tab), and N (new-line) added as highlighting only.
[..._some_action] added as explanation only.
Explanation in pseudo-code:
Integer i = STDIN-input as integer
If i modulo-25 is 0:
  If i modulo-16 is 0:
    Print 1
  Else:
    Print 0
Else-if i modulo-4 is 0:
  Print 1
Else:
  Print 0

Example runs:
Input: 1936
Command     Explanation                Stack            Heap       STDIN    STDOUT   STDERR

SSSN        Push 0                     [0]              {}
SNS         Duplicate top (0)          [0,0]            {}
SNS         Duplicate top (0)          [0,0,0]          {}
TNTT        Read STDIN as integer      [0,0]            {0:1936}   1936
TTT         Retrieve at heap 0         [0,1936]         {0:1936}
SNS         Duplicate top (1936)       [1936,1936]      {0:1936}
SSSTTSSTN   Push 25                    [1936,1936,25]   {0:1936}
TSTT        Modulo                     [1936,11]        {0:1936}
NTSTN       If 0: Jump to Label_TRUE   [1936]           {0:1936}
SSSTSSN     Push 4                     [1936,4]         {0:1936}
TSTT        Modulo                     [0]              {0:1936}
NTSSN       if 0: Jump to Label_LEAP   []               {0:1936}
NSSSN       Create Label_LEAP          []               {0:1936}
SSSTN       Push 1                     [1]              {0:1936}
NSSN        Create Label_PRINT         [1]              {0:1936}
TNST        Print top as integer       []               {0:1936}            1
                                                                                error

Program stops with an error: No exit defined.
Try it online (with raw spaces, tabs and new-lines only).
Input: 2400
Command     Explanation                Stack            Heap       STDIN    STDOUT   STDERR

SSSN        Push 0                     [0]              {}
SNS         Duplicate top (0)          [0,0]            {}
SNS         Duplicate top (0)          [0,0,0]          {}
TNTT        Read STDIN as integer      [0,0]            {0:2400}   2400
TTT         Retrieve at heap 0         [0,2400]         {0:2400}
SNS         Duplicate top (2400)       [2400,2400]      {0:2400}
SSSTTSSTN   Push 25                    [2400,2400,25]   {0:2400}
TSTT        Modulo                     [2400,0]         {0:2400}
NTSTN       If 0: Jump to Label_TRUE   [2400]           {0:2400}
NSSTN       Create Label_TRUE          [2400]           {0:2400}
SSSTSSSSN   Push 16                    [2400,16]        {0:2400}
TSTT        Modulo                     [0]              {0:2400}
NTSSN       If 0: Jump to Label_LEAP   []               {0:2400}
NSSSN       Create Label_LEAP          []               {0:2400}
SSSTN       Push 1                     [1]              {0:2400}
NSSN        Create Label_PRINT         [1]              {0:2400}
TNST        Print top as integer       []               {0:2400}            1
                                                                                error

Program stops with an error: No exit defined.
Try it online (with raw spaces, tabs and new-lines only).
Input: 1991
Command     Explanation                Stack            Heap       STDIN    STDOUT   STDERR

SSSN        Push 0                     [0]              {}
SNS         Duplicate top (0)          [0,0]            {}
SNS         Duplicate top (0)          [0,0,0]          {}
TNTT        Read STDIN as integer      [0,0]            {0:1991}   1991
TTT         Retrieve at heap 0         [0,1991]         {0:1991}
SNS         Duplicate top (1991)       [0,1991,1991]    {0:1991}
SSSTTSSTN   Push 25                    [0,1991,1991,25] {0:1991}
TSTT        Modulo                     [0,1991,16]      {0:1991}
NTSTN       If 0: Jump to Label_TRUE   [0,1991]         {0:1991}
SSSTSSN     Push 4                     [0,1991,4]       {0:1991}
TSTT        Modulo                     [0,3]            {0:1991}
NTSSN       if 0: Jump to Label_LEAP   [0]              {0:1991}
NSSN        Create Label_PRINT         [0]              {0:1991}
TNST        Print top as integer       []               {0:1991}            0
                                                                                error

Program stops with an error: No exit defined.
Try it online (with raw spaces, tabs and new-lines only).

ActionScript 2.0, 49 bytes
function a(b){trace(!(b%4)&&b%100+!(b%400)?1:0);}
function a(b){                                  } - define a function
              trace(                          );  - that outputs
                                          ?       - if
                    !(b%4)                        - the input divides by 4
                          &&                      - and
                            b%100                 - doesn't divide by 100
                                 +                - plus
                                  !(b%400)        - does divide by 400
                                           1:0    - 1, else 0

Not a very good explanation, and I might have swapped some stuff, but this still confuses me, so this is the best you're going to get.

C (gcc), 33 bytes
f(i,a){a=!(i%4|!(i%100)&&i%400);}

Try it online!

JavaScript, 19 bytes
y=>!(y%25?y%4:y%16)

Try it online!

Swift, 82 bytes
func l(y:Int){y%4==0 && (y%100 != 0 || y%400==0) ?print("Y"):print("N")}
l(y:1936)

Try it online!

A leap year ERE is not a "language" per se but it should be easily adaptable to any flavor of regex
(I think it should work for any year, including negative years and also waaaaaaay in the future, assuming proleptic Gregorian calendar)
ereLEAP := /(([2468][048]|[13579][26]|(^|[0+-])[48])(00)?|0000|^[+-]?0*)$/

so an awk solution using it would be like

awk 'function leap(_) {
         return _~"(([2468][048]|[13579][26]|(^|[0+-])" \
                  "[48])(00)?|0000|^[+-]?0*)$" ? "y" : "n" } ($2 = leap($1))^_'

and it properly captures the special edge cases, including strangely formatted inputs like negative zero :
-2400
-2000
-1600
-1200
-800
-400
-0
0
400
800
1200
1600
2000
2400

777778000
777778400
777778800
777779200
777779600
777780000
777780400
777780800
777781200
777781600
777782000
777782400

or ultra extreme inputs, like the year
9745314011399999080353382387875188310876226857595007526867
9064572129486907664261024656150658820102592253049162314086
6818345916986520309404657798729631265341953127769995647302
9870789655490053648352799593479218378873685597925394874945
746363615468965612827738803104277547081828589991914111200

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


text:
XKCD Bracket Probabilities
Today's XKCD is a sports-tournament style bracket, where the contestants are well-known names, put into groups of possibly confusing names.
Give the probability that a given contestant will win the entire tournament, based on each contestant in a given round having an equal chance of winning that round.
Input
The name of a contestant.

XKCD likes to use all upper case, but you may use whatever case makes sense for you or make your input case insensitive.
You may assume all input names are valid.
Jeff Gordan is probably a misspelling of Jeff Gordon.  You may choose to accept either or both of these.
Some names include punctuation, e.g. H. G. Wells and Joseph Gordon-Levitt.  You may choose to accept names with or without punctuation (or both).  The above without punctuation would be H G Wells and Joseph Gordon Levitt
Similarly, you may choose to accept either Beyoncé or Beyonce or both
The Mister/Fred Astaire/Rogers line is a bit odd.  For this one, you must accept all of the following: Fred Rogers, Mister Rogers and Fred Astaire

Output
The probability of the given contestant winning the whole tournament, in rational form (e.g. 1/64)
Examples

Louis Armstrong will potentially play in 6 rounds, each with two contestants, so he has a 1/64 chance of winning.
Alan Rickman will potentially play in 7 rounds, the first with 3 contestants and the rest with 2 contestants, so he has a 1/192 chance of winning.

To save you the effort of typing in all the names from the image, explainXKCD already has them tabulated.  I've also dumped them to this pastebin.
Note the winning probabilities in the explainXKCD are wrong - they are twice as big as they should be because they are presumably forgetting the final round.  Thanks for pointing this out @Geobits.

so we have to first convert the image into text and then hardcode probability buckets .. ughh

@Optimizer explainxkcd can help you with that

@MartinBüttner That's dope

@Optimizer no image conversion required :)

You should link that in the question at the end...

@Optimizer Done.

These odds (examples and explain.xkcd) are all too high, because they're forgetting the last match (between winners of each side). Each should be halved.

@Geobits facepalm - let me fix that!

@sanchises Please see the second bullet point in the input spec.

explainxkcd is a wiki; why fix it with a note in the spec when you could fix it for everyone? :P

Relevant Twitter account..

CJam, 161 bytes
1'/l_"FRE"#\_'É#)\2b626%536%"òazíF.?§·»ùßóÿ÷ýÿÿ»×ï_ÿÿ¿ß÷ä¿ûïÿÏÅÿ¿ÿÿ~ÿþÿýó½ïÿþþ/ïþÿ®þü¾ùÿ®÷/"256b2b2*<1-,"ãÍÕý*ÔÞ)ð^sV? Ìöî²\ÅlÕáS{Á"260b5b=5,Z6t=2+1\?4?32*

This is a full program that expects uppercase input, with punctuation and accents exactly as shown in the pastebin.
Try it online in the CJam interpreter.
How it works
1'/      e# Push a 1 and a slash.
l        e# Read a line of input from STDIN.
_"FRE"#  e# Push 0 if the input starts with "FRE" and a truthy value otherwise.
\_'É#)   e# Push 1 if the input doesn't contain "É" and a falsy value otherwise.

         e# Now we hash the input:
\2b      e#     Apply base 2 conversion to turn the input into an integer.
626%536% e#     Take that integer modulo 626, then modulo 536.

"òazíF.?§·»ùßóÿ÷ýÿÿ»×ï_ÿÿ¿ß÷ä¿ûïÿÏÅÿ¿ÿÿ~ÿþÿýó½ïÿþþ/ïþÿ®þü¾ùÿ®÷/"256b2b2*

         e# Convert the string from base 256 to base 2 and repeat it.
         e# The resulting array, [1 1 1 1 0 0 1 0 0 ...], contains a 0 at index X
         e# if and only if there is a possible input with hash X.

<        e# Keep the binary values before the index of the input hash.
<1-,     e# Count the number of zeroes.

"ãÍÕý*ÔÞ)ð^sV?  Ìöî²\ÅlÕáS{Á"260b5b

         e# Convert the string from base 260 to base 5.
         e# The resulting array, [2 2 2 2 2 0 4 4 0 0 ...], contains a diffrent
         e# integer for every different probability. The input with the lowest hash
         e# corresponds to the first index, the one with the highest to the last.

=        e# Retrieve the integer corresponding to the input.
5,Z6t=   e# Retrieve the corresponding element from [0 1 2 6 4].
2+       e# Add two.
1\?      e# Select the result from above or 1 for BEYONCÉ.
4?       e# Select the result from above or 4 for and FRED.
32*      e# Multiply by 32.

I've taken the probabilities from explainxkcd (multiplied by 2) and filled in the gaps. Hopefully, everything is correct. Fixing any probability should not  have an impact on the byte count.

source: Stack Exchange

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

sort: votes


text:
Permutations of the Fifteen Puzzle
The Challenge
Consider the following diagram of the Fifteen Puzzle in its solved state:
_____________________
|    |    |    |    |
| 1  | 2  | 3  | 4  |
|____|____|____|____|
|    |    |    |    |
| 5  | 6  | 7  | 8  |
|____|____|____|____|
|    |    |    |    |
| 9  | 10 | 11 | 12 |
|____|____|____|____|
|    |    |    |    |
| 13 | 14 | 15 |    |
|____|____|____|____|

At every move, an excited puzzler has the opportunity to move one piece adjacent to the blank space into the blank space. For example, after 1 move, we have 2 possible scenarios (let 0 be a blank space):
1   2   3   4          1   2   3   4
5   6   7   8          5   6   7   8
9   10  11  12   and   9   10  11  0
13  14  0   15         13  14  15  12

After 2 moves, the puzzle has 5 different outcomes (Note that the two cases above are excluded, since they cannot be reached in 2 moves). One of these situations is the original solved state, and can be reached in two different ways.
Your task in this challenge is to produce the number of different outcomes that a certain number of moves can lead to. As input, take a number N >= 0, and output the number of unique situations that may appear after N moves.
Rules

This is code-golf. Shortest code wins!
Standard loopholes are disallowed.
Your code should be able to compute the case for N = 10 within a few minutes. I will likely not test this rule unless an obvious abuse of time exists in an answer.

Test Cases
(Results generated from summations of OEIS A089484 (As Geobits described in chat), automated by Martin Büttner's script. Thanks for all the help!)
0 moves: 1
1 moves: 2
2 moves: 5
3 moves: 12
4 moves: 29
5 moves: 66
6 moves: 136
7 moves: 278
8 moves: 582
9 moves: 1224
10 moves: 2530
11 moves: 5162
12 moves: 10338
13 moves: 20706
14 moves: 41159
15 moves: 81548
16 moves: 160159
17 moves: 313392
18 moves: 607501
19 moves: 1173136
20 moves: 2244884
21 moves: 4271406
22 moves: 8047295
23 moves: 15055186
24 moves: 27873613
25 moves: 51197332
26 moves: 93009236
27 moves: 167435388
28 moves: 297909255
29 moves: 524507316
30 moves: 911835416
31 moves: 1566529356

Pyth, 36 bytes
lu{smmXd,0@dk)fq1.a.DR4,Txd0UdGQ]U16

Demonstration. Test harness.
lu{smmXd,0@dk)fq1.a.DR4,Txd0UdGQ]U16

                 .a.DR4,Txd0            Find the Euclidean distance between the
                                        present location of 0 and a given location.
              fq1           Ud          Filter over all locations on that distance
                                        equaling 1.
     mXd,0@dk)                          Map each such location to the grid with 0
                                        and the value at that location swapped.
  {sm                         G         Map all unique grids possible after n-1
                                        steps to all unique grids after n steps.
 u                             Q]U16    Repeat <input> times, starting with the
                                        initial grid.
l                                       Print the length of the resulting set.

CJam, 54 52 51 50 49 47 45 bytes
G,ari{{:S0#S{4md2$4md@-@@-mh1=},f{Se\}}%:|}*,

Try it online in the CJam interpreter (should take less than 10 seconds).
How it works
G,a       e# Push R := [[0 1 ... 15]].
ri{       e# Do int(input()) times:
  {:S     e#   For each S in R:
    0#    e#     Push the index of 0 in S (I).
    S{    e#     Filter S; for each J in in S:
      4md e#       Push J/4 and J%4.
      2$  e#       Copy I.
      4md e#       Push I/4 and I%4.
      @-  e#       Compute (I%4)-(J%4).
      @@- e#       Compute (J%4)-(I%4).
      mh  e#       2-norm distance: a b -> sqrt(aa + bb)
      1=  e#       Check if the distance is 1.
    },    e#     Keep all values of J with distance 1 from I.
    f{    e#     For each J:
      S   e#       Push S.
      e\  e#       Swap S at indexes I and J.
    }     e#     This pushes an array of all valid modifications of S.
  }%      e#   Collect the results for all S in R in an array.
  :|      e#   Reduce the outmost array using set union (removes duplicates).
}*        e#

Retina, 289 276 bytes
^
,abcd%efgh%ijkl%mnox,
(`(,[^,]*)x([^,%])([^,y]*),
$0$1$2x$3y,
(,[^,]*)([^,%])x([^,y]*),
$0$1x$2$3y,
(,[^,]*)x([^,]{4})([^,])([^,y]*),
$0$1$3$2x$4y,
(,[^,]*)([^,])([^,]{4})x([^,y]*),
$0$1x$3$2$4y,
,.{19},(?=.*1)|,[^,]{20},(?=[^1]*$)|y|1$

+)`([^,]{19})(.*),\1,
$1$2
[^a]

a
1

Takes input and prints output in unary.
You can put each line in a single file or run the code as is with the -s flag. E.g.:
> echo -n 111|retina -s fifteen_puzzle
111111111111

The core of the method is that we keep track of all possible positions (without repetition) which can occur after exactly k steps. We start form k = 0 and repeat the substitution steps (using the (` and )` modifiers) until we reach the input number of steps.
During this computation our string always has the form of
(,[puzzle_state]y?,)+1*

where puzzle_state is abcd%efgh%ijkl%mnox with some permutation of the letters. x stands for the empty place, the rest of the letters are the tiles. %'s are row delimiters.
y marks that the state is generated in the current step (k) so it shouldn't be used to generate other states in this step.
1's mark the number of steps left.
The basic mechanic of the Retina code is that every match of an odd line is changed to the next (even) line.
The code with added explanation:
initialize string
^
,abcd%efgh%ijkl%mnox,

while string changes
(`

for every old (y-less) state concatenate a new state with moving the empty tile to r/l/d/u if possible
right
(,[^,]*)x([^,%])([^,y]*),
$0$1$2x$3y,
left
(,[^,]*)([^,%])x([^,y]*),
$0$1x$2$3y,
down
(,[^,]*)x([^,]{4})([^,])([^,y]*),
$0$1$3$2x$4y,
up
(,[^,]*)([^,])([^,]{4})x([^,y]*),
$0$1x$3$2$4y,

if we should have made this step (there are 1's left) remove old states
,.{19},(?=.*1)

if we should not have made this step (no more 1's left) remove new states
,[^,]{20},(?=[^1]*$)

remove y markers
y

remove one 1 (decrease remaining step count)
1$

remove duplicates until string changes (with + modifier)
+`([^,]{19})(.*),\1,
$1$2

end while
)`

remove non-a's, 1 a stays from each state
[^a]

change a's to 1's
a
1

10 bytes saved thanks to @MartinButtner.

Python, 310 253 243 229 bytes
Latest version with improvement suggested by @randomra:
s=set()
s.add(tuple(range(16)))
def e(a,b):s.add(t[:a]+(t[b],)+t[a+1:b]+(t[a],)+t[b+1:])
for k in range(input()):
 p,s=s,set()
 for t in p:j=t.index(0);j%4and e(j-1,j);j%4>2or e(j,j+1);j<4or e(j-4,j);j>11or e(j,j+4)
print len(s)

My own version, which was longer (243 bytes), but easier to read:
s=set()
s.add(tuple(range(16)))
def e(a,b):s.add(t[:a]+(t[b],)+t[a+1:b]+(t[a],)+t[b+1:])
for k in range(input()):
 p,s=s,set()
 for t in p:
  j=t.index(0)
  if j%4:e(j-1,j)
  if j%4<3:e(j,j+1)
  if j>3:e(j-4,j)
  if j<12:e(j,j+4)
print len(s)

Simple breadth first search, encoding the states as tuples, and storing them in a set to keep them unique.
Takes about 0.03 seconds on my laptop for N=10. Running time does increase substantially for larger numbers, for example about 12 seconds for N=20.

Aliasing s.add would probably save some characters.

@isaacg I saved quite a bit by moving the similar code into a function. Looking at this now, I probably don't have to pass t as an argument. Other than that, I figure there's most likely more room for improvement if I had better Python skills.

You can convert the if statements into short-circuiting expressions with side effect like j%4and e(j-1,j) so you can put them into one line as a boolean tuple: j%4and e(j-1,j),j%4>2or e(j,j+1),j<4or e(j-4,j),j>11or e(j,j+4).

@randomra Sounds good, I'll try that tomorrow. I thought there was probably some clever way of using conditional expressions instead of the series of if statements. I also wonder if there's a shorter way of building a tuple with two elements swapped.

Converting to list, swapping and converting back to tuple is a little shorter: def e(a,b):*l,=t;l[a],l[b]=l[b],l[a];s.add(tuple(l)).

@randomra: As far as I know, *l,=t works only in Python 3, which would require int() around input() and () around len(S). l=list(t) works and  improves readability immensely, but it doesn't save bytes.

@Dennis Right, for some reason I tested it in Python 3.

Perl, 148
#!perl -p
$s{"abcd.efgh.ijkl.mno#"}=1;for(1..$_){$x=$_,map{$r{$_}=1if
s/($x)/$3$2$1/}keys%s for
qw!\w)(# #)(\w \w)(.{4})(# #)(.{4})(\w!;%s=%r;%r=()}$_=keys%s

Example:
$ time perl 15.pl <<<20
2244884
real    0m39.660s
user    0m38.822s
sys 0m0.336s

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


text:
Packing Wood Pieces
There are two pieces of wood. Both consist of a straight body and some extra blocks below the body. An example piece with extra blocks at (0-indexed) positions 0,4,7,9,10:
XXXXXXXXXXX
X   X  X XX

The piece can be represented as a 01 binary sequence with the ith character showing if there is a block at the ith position. The upper example can be represented as 10001001011.
We can put together two pieces by vertically flipping the second one (and maybe flipping it horizontally too). After the flip(s) we can find an alignment where the two pieces can be put together to have a height of 3.
Two example pieces:

XXXXXXXXXXX   XXXXXXXX
X   X  X XX     XXX

Second piece flipped vertically and horizontally:

 XXXXXXXXXXX
 X   X  X XX
  XXX
XXXXXXXX

Pieces put together:

 XXXXXXXXXXX
 XXXXX  X XX
XXXXXXXX

The example resulted in a total width of 12 blocks.
You should write a program or function which receives two string as input representing the two pieces and outputs an integer the minimal achievable width with a height of 3.
Input

Two strings consisting of the characters 0 and 1.
Both strings contain at least one character.
You may choose to receive the two strings as one joined by a single space.

Output

A single positive integer, the minimal total width achievable.

Examples
0 0  =>  1

1 0  =>  1

1 1  =>  2

11 111  =>  5

010 0110  =>  5

0010 111  =>  5

00010 11011  =>  6

01010 10101  =>  5

1001 100001  =>  6

1110001100001 1100100101  =>  14

001101010000101 100010110000  =>  16

0010110111100 001011010101001000000  =>  21

0010110111100 001011010101001001100  =>  28

100010100100111101 11100101100010100100000001  =>  27

0010 10111  =>  5

0100 10111  =>  5

0010 11101  =>  5

0100 11101  =>  5

10111 0010  =>  5

10111 0100  =>  5

11101 0010  =>  5

11101 0100  =>  5

This is code golf so the shortest entry wins.

Is the piece in the first example supposed to be piece 1 in the second part of the example? If so, then one of them is wrong.

@mdc32 They weren't the same pieces but changed the first one to avoid confusion.

Pyth, 37 35 34 32 31 bytes
eSX0lM.zff-\1@VhY>eYT*Fm,d_d.z0

Takes input newline separated.
Demonstration, Test Harness.
Explanation:
At the high level, for each combination of normal and reversed strings, we shift the second string to the left by a given number of positions, and check for overlaps with the first string. This is repeated until a shift amount with no overlaps is found. That shift amount is added to the first string length, and the result is compared with the second string length. The higher value is printed.
eSX0lM.zff-\1@VhY>eYT*Fm,d_d.z0

                            .z     The list of the two input strings.
                       m           Map to
                        ,d_d       The pair of each string and its reverse.
                     *F            Take the cartesisan product of those lists.
         f                         Filter those pairs of a first string and a
                                   second string, possibly reversed,
          -\1                      On the absence of the string "1" in
             @V                    The vectorized intersection (intersection
                                   of 0th position, 1st position, etc.) of
               hY                  the first string and
                 >eYT              the second string without the first T elements.
        f                    0     Starting at 0 and counting upwards, find the
                                   lowest T where the result is truthy.
                                   (where anything passes the inner filter)
    lM.z                           Map the input strings to their lengths.
  X0                               Add the above result to the first entry.
eS                                 Take the maximum of the two values and print.

Pip, 72 70 48 bytes
Fp[aRVa]CP[bRVb]L#a+1{I2NI$+plAE:#$+^pp@1.:0}MNl

Takes the two strings as command-line arguments. Formatted, with comments:
                     a, b initialized from cmdline args; l is [] (implicit)
F p [aRVa]CP[bRVb]   For each possible pair p of a/reverse(a) with b/reverse(b):
 L #a+1 {            Loop for each potential offset of bottom piece:
  I 2 NI $+p         If no 2's in the sum of p:
   l AE: # $+ ^p     Append the max width of elements of p to l (see below for explanation)
  p@1 .: 0           Append a 0 to bottom piece
 }
MNl                  The answer is min(l); print it (implicit)

We're only calculating the overlaps where the bottom piece sticks out to the left, so we need to try it with both top and bottom pieces reversed. Each time through the inner loop, if there are no 2's in the sum, it is a fit; we then tack another zero onto the the end of the bottom piece and try again.
   0010
    111
   0121

   0010
   111_
   1120

   0010
  111__
  11110

   0010
 111___
 111010

   0010
111____
1110010

To find the total width, we split the elements of p into lists of characters and sum. Item-wise operations on uneven-length lists preserve the length of the longer one, so the length of this sum is exactly what we need. (Splitting is necessary because simply summing as numbers will eliminate leading zeros: $+[0101 10] = 111, but $+^[0101 10] = [0 1 1 1].)
C:\> pip.py woodPacking.pip 0010 111
5

Ruby 127 130
This turned out to be so long... :(
->m,n{[[m,n],[m,n.reverse],[n,m],[n,m.reverse]].map{|u,d|[(0..l=u.size).find{|i|(d.to_i(2)<<i)&u.to_i(2)<1}+d.size,l].max}.min}

Tests: http://ideone.com/te8XWk
Readable Ruby:
def pack_length piece1, piece2
  min_possible_packed_length = [
    min_packed_length(piece1, piece2),
    min_packed_length(piece1, piece2.reverse),
    min_packed_length(piece2, piece1),
    min_packed_length(piece2, piece1.reverse)
  ].min

  min_possible_packed_length
end

def min_packed_length up_piece, down_piece
  x = up_piece.to_i 2
  y = down_piece.to_i 2

  # find the smallest shift for the piece placed down
  # so that they fit together
  min_packed_shift = (0..up_piece.size).find{|i| (y<<i)&x<1 }

  # min pack length cannot be smaller than any of the
  # two pieces
  [min_packed_shift + down_piece.size, up_piece.size].max
end

Could you test the new added examples? The [[m,n],[m,n.reverse],[n,m],[n,m.reverse]] part might be incorrect. (I'm not sure but I made a similar mistake.)

@randomra Sure! Please see the test link; I added the new tests there.

Thanks, sorry for the extra hassle. My intuition was that you would need [n.reverse,m] instead of [n,m.reverse] but I don't know Ruby.

@randomra actually that fails the test '0010110111100', '001011010101001001100' saying Expected: 28,  Actual: 30. All other tests pass. So you've done a good job of testing corner cases. :)

JavaScript (ES6) 160
Couldn't make shorter ...

F=(a,b,c=[...b].reverse(),
K=(a,b,t=a.length)=>{
for(e=i=-1;e&&i++<t;)for(e=j=0;u=b[j];j++)e|=u&a[j+i];
return tMath.min(K(a,b),K(a,c),K(b,a),K(c,a))

// test

out=x=>O.innerHTML += x+'\n'

test=[
 ['0', '0', 1],['1', '0', 1],['1', '1', 2],['11', '111', 5]
,['010', '0110', 5],['0010', '111', 5],['0010', '10111', 5]
,['00010', '11011', 6],['01010', '10101', 5],['1001', '100001', 6]
,['1110001100001', '1100100101', 14]
,['001101010000101', '100010110000', 16]
,['0010110111100', '001011010101001000000', 21]
,['0010110111100', '001011010101001001100', 28]
,['100010100100111101', '11100101100010100100000001', 27]
,['0010','10111', 5],['0100','10111', 5]
,['0010','11101', 5],['0100','11101', 5]
,['10111','0010', 5],['10111','0100', 5]
,['11101','0010', 5],['11101','0100', 5]
]

test.forEach(t=>{
  r = F(t[0],t[1]),
  out(
    (r==t[2]?'Ok':'Fail')
    + ' A: '+t[0]+', B: '+t[1]
    + ', Result: '+r + ', Check:  '+t[2])
})
pre { font-size: 10px }


text:
Generalized integer casting in Python
Background
I have a string in Python which I want to convert to an integer. Normally, I would just use int:
>>> int("123")
123

Unfortunately, this method is not very robust, as it only accepts strings that match -?[0-9]+ (after removing any leading or trailing whitespace). For example, it can't handle input with a decimal point:
>>> int("123.45")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: invalid literal for int() with base 10: '123.45'

And it certainly can't handle this:
>>> int("123abc?!")

On the other hand, exactly this behavior can be had without any fuss in Perl, PHP, and even the humble QBasic:
INT(VAL("123abc"))   ' 123

Question
Here's my shortest effort at this "generalized int" in Python. It's 50 bytes, assuming that the original string is in s and the result should end up in i:
n="";i=0
for c in s:
 n+=c
 try:i=int(n)
 except:0

Fairly straightforward, but the try/except bit is ugly and long. Is there any way to shorten it?
Details
Answers need to do all of the following:

Start with a string in s; end with its integer value in i.
The integer is the first run of digits in the string. Everything after that is ignored, including other digits if they come after non-digits.
Leading zeros in the input are valid.
Any string that does not start with a valid integer has a value of 0.

The following features are preferred, though not required:

A single - sign immediately before the digits makes the integer negative.
Ignores whitespace before and after the number.
Works equally well in Python 2 or 3.

(Note: my code above meets all of these criteria.)
Test cases
"0123"   -> 123
"123abc" -> 123
"123.45" -> 123
"abc123" -> 0
"-123"   -> -123 (or 0 if negatives not handled)
"-1-2"   -> -1 (or 0 if negatives not handled)
"--1"    -> 0
""       -> 0

Somewhat related: http://codegolf.stackexchange.com/questions/28783/implement-an-integer-parser (but there it was explicitly stated that input would be properly-formed integers).

What should "12abc3" give?

@orlp 12--it's analogous to the "123.45" case.

(lambda(x)(or(parse-integer x :junk-allowed t)0)) (Common Lisp, 49 bytes) -- Only posted as a comment since it is built-in.

@coredump :junk-allowed--ha, that's great!  I would have made this a general golf challenge, were it not for the fact that the answer in many languages is trivial.  But thanks for the Lisp.  :^)

40 bytes
import re;i=int("0"+re.split("\D",s)[0])

and you can do negatives for 8 characters more:
import re;i=int((re.findall("^-?\d+",s)+[0])[0])

@DLosc Ah you're right, didn't test the second one well enough apparently. The 'aha' moment was when I realized some python regex functions return strings not MatchObjects

import re;i=int((re.findall("^-?\d+",s)+[0])[0]) works, for 48 bytes.

Python 2, 47, 46
It's not as short as using regex, but I thought it was entertainingly obscure.
i=int(('0%sx'%s)[:~len(s.lstrip(str(1<<68)))])

-1 due to KSab – str with some large integer works better than the repr operator since it does not put an L on the end.

you can shave off a byte by using str(1<<68) inside the lstrip

Wow.  Entertainingly obscure is right!  (This only handles nonnegative numbers, correct?)

Another bonus of @KSab's suggestion is Python 3 compatibility.


text:
Save the Geese from Extinction
The species of geese known as Alex A are known for residing in triangular grids consisting of 64 cells:

(Picture taken from this unrelated Project Euler problem.)
We'll label each cell with the numbers 0 to 63 starting from the top row and then moving from left to right on each row below that. So the top cell is 0 and the bottom-right cell is 63.
Each cell has three borders. We can label each border in the form a,b where a and b are the numbers of the cells that share that border. For instance, the border between cell 0 and 2 would be called 0,2 or 2,0 (it doesn't matter what order you put them in).
The labeling system for borders on the very edge of the grid are different, since the cells on the edge of the grid have a border that they don't share with other cells. If a border is only part of one cell, we will use the letter X. For instance, the three borders of cell 0 are 0,2, 0,X, and 0,X.
Some of the cells contain geese. However, these geese will be killed by evil foxes (that come from outside the borders of the grid) if you don't protect them. And if all the geese die then BrainSteel will be sad. Therefore we will write a program that builds fences around the geese to protect them from the foxes. The geese should exist in a single fully enclosed polygon of fences. Our fence budget is quite low so use the least number of fences possible.
Input Description
A list of numbers, comma separated, from 0 to 63, representing the cells that contain geese. Example:
6,12

Output Description
A list of borders that need to have fences built on them to protect the geese successfully. This should be the smallest number of fences possible. Example:
5,6 6,7 11,12 12,13

"The geese should exist in a fully enclosed polygon of fences." Must all the geese live in the same polygon, or may there be multiple (or 0) polygons?

@feersum All the geese should live in the same polygon. I've edited the question to make it clear.

@Katya May the polygon have self-intersections or zero-width sections? Think like an hourglass shape.

@orlp What is a zero-width section?

@orlp Forgot to answer the first question. The polygon cannot self intersect.

@Katya Something like this: https://gist.github.com/orlp/3e40b5b40f5d84a4651d.

@orlp The polygon should not contain zero width sections.

C#, 530 bytes
Complete C# program, takes input as a single line from STDIN, and outputs a single line to STDOUT, with a trailing " ".
This is rather long... and has way too much x/y/z repetition, but I've not been able to reduce it to anything sensible thus far, and have an exam in 2 hours, might come back to this tomorrow.
using Q=System.Console;class P{static void Main(){int q=9,w=0,e=9,r=0,t=9,u=0,i=0,x=0,y=0,z=0,p=0;System.Action V=()=>{z=(int)System.Math.Sqrt(i);p=(x=i-z*z)%2;x/=2;y=(++z*z--+~i)/2;},W=()=>{Q.Write(i+","+(x<0|y++<0|z>7?"X":""+(z*z+2*x+1-p))+" ");};foreach(var g in Q.ReadLine().Split(',')){i=int.Parse(g);V();q=q>x?x:q;w=w<x?x:w;e=e>y?y:e;r=r<y?y:r;t=t>z?z:t;u=u<z?z:u;}for(i=64;i-->0;){V();if(!(x<q|x>w|y<e|y>r|z<t|z>u))if(p>0){if(y==r)W();if(x++==w)W();x--;if(z--==t)W();}else{if(y--==e)W();if(x--==q)W();x++;if(z++==u)W();}}}}

This diagram explains most of what is going on.

Recognize that because we can't have 0-width sections, a "hexagon" is always going to be the cheapest shape (and has the benefit of giving the geese the maximum of space to move in).
The program works by first translating all the input cell indices into x/y/z coords, and finding the min/max of each of x/y/z.
z = floor(root(i))
x = floor((i - z^2) / 2)
y = floor((z+1)^2 - i - 1) / 2)
p = (i - z^2) % 2

Next, it goes through each cell index, and checking if it fits in the 'hexagon' bound we have described. If it is then it checks if it's on any of the extreme edges of the bounds (i.e. x = xmin, or y = ymax) and adds corresponding edges if it is. It has to work out the index of the edge it's next to. For x and z, we just increment/decrement them however we want, and then use the following formula:
i = z^2 + 2*x + (1-p)

Notice that the "parity" always changes, and that y is not involved. For y, we don't have to change anything, but the code is a bit of a mess because it has to perform "triangle" bounds checking to detect whether the cell next door should be an "X" or not.
Example solution (Cells with geese just in from the three corners):
Input
2,50,62

Output
62,63 61,X 59,X 57,X 55,X 53,X 51,X 50,49 48,X 36,X 35,X 25,X 24,X 16,X 15,X 9,X 8,X 4,X 3,X 2,0 1,X

Tidier code with comments:
using Q=System.Console;

class P
{
    static void Main()
    {
        int q=9,w=0,e=9,r=0,t=9,u=0, // min/max x/y/z/ (init min high, and max low)
        i=0, // index of cell we are looking at
        x=0,y=0,z=0,p=0; // x,y,z dimension

        System.Action V=()=>
            { // translates the index into x/y/z/p
                z=(int)System.Math.Sqrt(i);
                p=(x=i-z*z)%2; // 'parity'
                x/=2; // see p assignment
                y=(++z*z--+~i)/2; // ~i == -i - 1
            },
            W=()=>
            { // writes out the edge of i, and the cell described by x/z/inverse of p   (the inversion of p handles y +/-)
                Q.Write(i+","+ // write out the edge
                        (x<0|y++<0|z>7?"X":""+(z*z+2*x+1-p)) // either X (if we go out of 'trianlge' bounds), or we translate x/z/inverse of p into an index
                        +" "); // leaves a trailing space (as shown in example output)
            };

        foreach(var g in Q.ReadLine().Split(',')) // for each cell with geese
        {
            i=int.Parse(g); // grab index of cell
            V(); // compute x/y/z/p
            q=q>x?x:q; // sort out mins/maxes
            w=w<x?x:w;
            e=e>y?y:e;
            r=r<y?y:r;
            t=t>z?z:t;
            u=u<z?z:u;

            // code like the above suggests a solution with a couple of arrays would be better...
            // I've not had success with that yet, but maybe in a couple of days I will try again
        }

        for(i=64;i-->0;) // for each cell
        {
            V(); // compute x/y/z/p
            if(!(x<q|x>w|y<e|y>r|z<t|z>u)) // if we are inside the 'hex' bounds
                if(p>0)
                { // x max, y max, z min
                    // these checks check that we are on the extremes of the 'hex' bounds,
                    // and set up the appropriate vars for W calls to put the edges in
                    // must do y first, because W modifies it for us (saves 2 bytes in the next block)
                    if(y==r) // don't need the ++ (can't go out of 'trianlge' bounds)
                        W();
                    if(x++==w)
                        W();
                    x--;
                    if(z--==t)
                        W();
                    //z++; not used again
                }
                else
                { // x min, y min, z max
                    if(y--==e) // do need the -- (used for 'trianlge' bounds checking)
                        W();
                    // y is reset in W, as such
                    if(x--==q)
                        W();
                    x++;
                    if(z++==u)
                        W();
                    //z--; not used again
                }
        }
    }
}

You can save a byte with using System;.

@LegionMammal978 infact he gains two doing that.. He only uses it for Q.Write and Q.ReadLine. those, plus the using statement he has now is using Q=System.Console;Q.Write();Q.ReadLine() (45 Bytes) versus your suggestion using System;Console.Write();Console.ReadLine() (47 Bytes).

Also, you can drop 10 bytes by not needlessly initializing i, x, y, z, and p to 0.

@LegionMammal978 you sure? I tried that and it's giving errors for using a un-assigned vairable.

@Vioz- Which variables? Which lines on the annotated version?

@LegionMammal978 quite right about using System;, shameful that I neglected that, saves 11 bytes ;) as Vioz says, I need to assign the vars because they are accessed or assigned by the lambdas. Some re-ordering may save one or two bytes, I'll look into it tomorrow when I have less going on. (I shan't re-post the code unless I remove a good 10% or so, however).

But they are all assigned before they are used.

@LegionMammal978 the compiler doesn't know that the lambda will have assinged them, and removing the initilisation of q, for example, yields a "Use of unassigned variable" on the line q=q>x?x:q. For i it's the other way round, the lambda isn't sure that it's assigned by the code before it is called.