text:
Convert Salesforce 15-character ID to 18-character
In Salesforce CRM, every object has 15-character alphanumeric ID, which is case-sensitive. If anyone's curious, actually it's base-62 number.
However, tools used for data migration and integration may or may not support case sensitivity. To overcome that, IDs can be safely converted to 18-character case-insensitive alphanumeric IDs. In that process 3-character alphanumeric checksum is appended to the ID. The conversion algorithm is:
Example:
a0RE000000IJmcN

Split ID into three 5-character chunks.
a0RE0  00000  IJmcN

Reverse each chunk.
0ER0a  00000  NcmJI

Replace each character in every chunk by 1 if it's uppercase or by 0 if otherwise.
01100  00000  10011

For each 5-digit binary number i, get character at position i in concatenation of uppercase alphabet and digits 0-5 (ABCDEFGHIJKLMNOPQRSTUVWXYZ012345).
00000 -> A,
00001 -> B,
00010 -> C, ...,
11010 -> Z,
11011 -> 0, ...,
11111 -> 5`

Yielding:
M  A  T

Append these characters, the checksum, to the original ID.

Output:
a0RE000000IJmcNMAT

Write program or function which takes 15-character alphanumeric (ASCII) string as input and returns 18-character ID.
Input validation is out of scope of this question. Programs may return any value or crash on invalid input.
Please, don't use Salesforce propretiary languages' features that make this challenge trivial (such as formula CASESAFEID(), converting Id to String in APEX &c).
Test Cases
a01M00000062mPg    -> a01M00000062mPgIAI
001M000000qfPyS    -> 001M000000qfPySIAU
a0FE000000D6r3F    -> a0FE000000D6r3FMAR
0F9E000000092w2    -> 0F9E000000092w2KAA
aaaaaaaaaaaaaaa    -> aaaaaaaaaaaaaaaAAA
AbCdEfGhIjKlMnO    -> AbCdEfGhIjKlMnOVKV
aBcDEfgHIJKLMNO    -> aBcDEfgHIJKLMNO025

Sadly, converting a string to an Id in Apex Code still wouldn't be shorter than some of the answers provided here, especially if the code must be self-contained. Apex Code is not well-suited for golfing.

@phyrfox as a former salesforce dev. Apex isn't suited for much...

APEX, 56 bytes: public class X{public X(Id i){System.debug((String)i);}}. Works only with valid Salesforce IDs, though.

I came here looking to actually do this for work (https://success.jitterbit.com/display/DOC/Formula+Builder+String+Function), not golf, but I'm a little confused by the description of the algorithm.  You say each reversed-and-sanitized chunk in step 4 will be a "binary number," but you never replace digits 2-8 with 0's and 1's.  What exactly am I supposed to do for step 4 when steps 1-3 on a chunk like "62mPg" have resulted in a number like "01026"?

Pyth, 23 22 bytes
1 byte saved by FryAmTheEggman.
sm@s+JrG1U6i}RJ_d2c3pz

Try it online. Test suite.
This might be the first time I've used the print instruction in golfing.
Explanation
     JrG1                   save uppercase alphabet in J
                     z      input string
                    p       print it without newline
                  c3        split into 3 parts
 m              d           for each part:
               _              reverse
            }R                map characters to being in
              J                 uppercase alphabet (saved in J)
           i     2            parse list of bools as binary
  @                           get correct item of
     J                          uppercase alphabet (saved in J)
   s+    U6                     add nums 0-5 to it
s                           concatenate and print

Ruby, 97 bytes
->s{s+s.scan(/.{5}/).map{|x|[*?A..?Z,*?0..?5][x.reverse.gsub(/./){|y|y=~/[^A-Z]/||1}.to_i 2]}*''}

->s{               # define an anonymous lambda
s+                 # the original string plus...
s.scan(/.{5}/)     # get every group of 5 chars
.map{|x|           # map over each group of 5 chars...
[*?A..?Z,*?0..?5]  # build the array of A-Z0-5
[                  # index over it with...
x.reverse          # the 5-char group, reversed...
.gsub(/./){|y|     # ... with each character replaced with...
y=~/[^A-Z]/||1     # ... whether it's uppercase (0/1)...
}.to_i 2           # ... converted to binary
]                  # (end index)
}*''               # end map, join into a string
}                  # end lambda

This one's got some really neat tricks.
My original instinct for splitting the string into groups of 5 chars was each_slice:
irb(main):001:0> [*1..20].each_slice(5).to_a
=> [[1, 2, 3, 4, 5], [6, 7, 8, 9, 10], [11, 12, 13, 14, 15], [16, 17, 18, 19, 20]]

Turns out that's waaay too long compared to a simple regex (x.chars.each_slice(5) vs. x.scan(/.{5}/)). This seems obvious in hindsight, but I never really thought about it... perhaps I can optimize some of my old Ruby answers here.
The thing I'm most proud of in this answer, though, is this piece of code:
y=~/[^A-Z]/||1

Alright, so here's some background for the non-Rubyists. Ruby completely separates booleans (TrueClass, FalseClass) from integers/numbers (Numeric)—that means there's no automatic conversion from true to 1 and false to 0 either. This is annoying while golfing (but a good thing... for all other purposes).
The naïve approach to checking whether a single character is uppercase (and returning 1 or 0) is
y.upcase==y?1:0

We can get this down a little further (again, with a regex):
y=~/[A-Z]/?1:0

But then I really started thinking. Hmm... =~ returns the index of a match (so, for our single character, always 0 if there's a match) or nil on failure to match, a falsy value (everything else except FalseClass is truthy in Ruby). The || operator takes its first operand if it's truthy, and its second operand otherwise. Therefore, we can golf this down to
y=~/[^A-Z]/||1

Alright, let's look at what's happening here. If y is an uppercase letter, it will fail to match [^A-Z], so the regex part will return nil. nil || 1 is 1, so uppercase letters become 1. If y is anything but an uppercase letter, the regex part will return 0 (because there's a match at index 0), and since 0 is truthy, 0 || 1 is 0.
... and only after writing all of this out do I realize that this is actually the same length as y=~/[A-Z]/?1:0. Haha, oh well.

MATL, 24 bytes
j1Y24Y2hG5IePtk=~!XB1+)h

Uses current version (9.1.0) of the language/compiler.
Examples
>> matl
 > j1Y24Y2hG5IePtk=~!XB1+)h
 >
> a0RE000000IJmcN
a0RE000000IJmcNMAT

>> matl
 > j1Y24Y2hG5IePtk=~!XB1+)h
 >
> a01M00000062mPg
a01M00000062mPgIAI

Explanation
j            % input string
1Y2          % predefined literal: 'ABC...Z'
4Y2          % predefined literal; '012...9'
h            % concatenate into string 'ABC...Z012...9'
G            % push input string
5Ie          % reshape into 5x3 matrix, column-major order
P            % flip vertically
tk=~         % 1 if uppercase, 0 if lowercase
!XB1+        % convert each column to binary number and add 1
)            % index 'ABC...Z012...9' with resulting numbers
h            % concatenate result with original string

JavaScript (ES6), 108
x=>x.replace(/[A-Z]/g,(x,i)=>t|=1<x+='ABCDEFGHIJKLMNOPQRSTUVWXYZ012345'[t>>n&31])&&x

Test

f=x=>x.replace(/[A-Z]/g,(x,i)=>t|=1<x+='ABCDEFGHIJKLMNOPQRSTUVWXYZ012345'[t>>n&31])&&x

// Less golfed

U=x=>{
  x.replace(/[A-Z]/g,(x,i)=>t|=1< // 3 value for shifting
    x += 'ABCDEFGHIJKLMNOPQRSTUVWXYZ012345' // to convert value to char
     [ t>>n&31 ] // shift and mask
  );
  return x
}

console.log=x=>O.innerHTML+=x+'\n';

;[
  ['a01M00000062mPg','a01M00000062mPgIAI']
, ['001M000000qfPyS','001M000000qfPySIAU']
, ['a0FE000000D6r3F','a0FE000000D6r3FMAR']
, ['0F9E000000092w2','0F9E000000092w2KAA']
, ['aaaaaaaaaaaaaaa','aaaaaaaaaaaaaaaAAA']
, ['AbCdEfGhIjKlMnO','AbCdEfGhIjKlMnOVKV']
, ['aBcDEfgHIJKLMNO','aBcDEfgHIJKLMNO025']
].forEach(t=>{
  var i=t[0],x=t[1],r=f(i);
  console.log(i+'->'+r+(r==x?' OK':' Fail (expected '+x+')'));
})

PHP, 186 181 bytes
<?$z=$argv[1];$x=str_split($z,5);$l="ABCDEFGHIJKLMNOPQRSTUVWXYZ012345";foreach($x as$y){foreach(str_split(strrev($y))as$a=>$w)$y[$a]=ctype_upper($w)?1:0;$z.=$l[bindec($y)];}echo $z;

Unglofed
<?php
$z = $argv[1];
$x = str_split($z,5);
$l = "ABCDEFGHIJKLMNOPQRSTUVWXYZ012345";
foreach($x as $y) {
    foreach( str_split( strrev($y) ) as $a => $w) {
        $y[$a] = ctype_upper($w) ? 1 : 0;
    }
    $z .= $l[bindec($y)];
}
echo $z;

I started out thinking I could make it much shorter than this, but I ran out of ideas to make it shorter.

JavaScript (ES6), 137 132 bytes
s=>s+s.replace(/./g,c=>c>"9"&c<"a").match(/.{5}/g).map(n=>"ABCDEFGHIJKLMNOPQRSTUVWXYZ012345"[0|"0b"+[...n].reverse().join``]).join``

4 bytes saved thanks to @ՊՓԼՃՐՊՃՈԲՍԼ!
Explanation
This challenge is not suited for JavaScript at all. There's no short way to reverse a string and it looks like the shortest way to convert the number to a character is to hard-code each possible character.
s=>
  s+                                   // prepend the original ID
  s.replace(/./g,c=>c>"9"&c<"a")       // convert each upper-case character to 1
  .match(/.{5}/g).map(n=>              // for each group of 5 digits
    "ABCDEFGHIJKLMNOPQRSTUVWXYZ012345"
    [0|"0b"+                            // convert from binary
      [...n].reverse().join``]          // reverse the string
  ).join``

If the digits in the checksum were allowed to be lower-case it could be done in 124 bytes like this:
s=>s+s.replace(/./g,c=>c>"9"&c<"a").match(/.{5}/g).map(n=>((parseInt([...n].reverse().join``,2)+10)%36).toString(36)).join``

Test

var solution = s=>s+s.replace(/./g,c=>c>"9"&c<"a").match(/.{5}/g).map(n=>"ABCDEFGHIJKLMNOPQRSTUVWXYZ012345"[0|"0b"+[...n].reverse().join``]).join``
<input type="text" id="input" value="AbCdEfGhIjKlMnO" />
<button onclick="result.textContent=solution(input.value)">Go</button>

If I'm not mistaken, parseInt([...n].reverse().join\`,2)could be changed to+`0b${[...n].reverse().join``}``.

@ՊՓԼՃՐՊՃՈԲՍԼ Right you are! I saved another byte on top of that too, thanks.

Save 10 whole bytes by using .replace(/.{5}/g,n=>/*stuff*/).

MATLAB, 100 98 bytes
s=input('');a=flip(reshape(s,5,3))';e=['A':'Z',48:53];disp([s,e(bin2dec(num2str(a~=lower(a)))+1)])

A string will be requested as input and the output will be displayed on the screen.
Explanation
I'm probably using the most straight-forward approach here:

Request input
Reshape to 5 (rows) x 3 (columns)
Flip the row order
Transpose the matrix to prepare it for being read as binary
Allocate the ABC...XYZ012345 array
Compare the character indices of the transposed matrix to its lower-case equivalent and convert the booleans to strings, which are then read as binary and converted to decimal.
Interpret these decimals (incremented by 1) as indices of the allocated array.
Display the input with the additional 3 characters

Now below 100 bytes thanks to Luis Mendo!

You can save a little using e=['A':'Z',48:53]

I see my approach is almost the same as yours :-)

CJam, 27 bytes
l_5/{W%{_el=!}%2bH+43%'0+}%

Run all test cases.
A fairly straightforward implementation of the spec. The most interesting part is the conversion to characters in the checksum. We add 17 to the result of each chunk. Take that modulo 43 and add the result of that to the character '0.

C, 120 118 bytes
n,j;main(c,v,s)char**v,*s;{for(printf(s=v[1]);*s;s+=5){for(n=0,j=5;j--;)n=n*2+!!isupper(s[j]);putchar(n+65-n/26*17);}}

Works for any input whose length is a multiple of 5 :)
Ungolfed
n,j;

main(c,v,s) char **v, *s;
{
    for(printf(s = v[1]); *s; s+=5)
    {
        for(n=0, j=5; j--;)
            n=n*2+!!isupper(s[j]);

        putchar(n+65-n/26*17);
    }
}

To save a few bytes you can remove n, from the global namespace if you use main(n,v,s) for your signature since you're not otherwise using argc.

Also replace 26*17 with plain old 442 saves another byte

With a few more edits I got your version down to 110 bytes.  I don't understand why you had !!isupprer() when isupper() seems to work fine for me.  Also I refactored your for loops to remove some unnecessary {}
j;main(n,v,s)char**v,*s;{for(printf(s=v[1]);*s;s+=5,putchar(n+65-n/442))for(n=0,j=5;j--;n=n*2+isupper(s[j]));}

@cleblanc Excellent suggestions, thanks very much. The order of operations is very important on the n/26*17 expression so replacing with 442 is not an option. As far as !!isupper, that function doesn't return 1 for true on my system, it returns 256. The !! is a short way to convert it to a 0/1 return value no matter what. YMMV.

Japt, 46 bytes
U+U®f"[A-Z]" ?1:0} f'.p5)®w n2 +A %36 s36 u} q

Not too happy with the length, but I can't find a way to golf it down.
Try it online!

Japt, 21 bytes
;+ò5 ®Ô£BèXÃÍgB¬c6oÃ¬

Try it (includes all test cases)
;+ò5 ®Ô£BèXÃÍgB¬c6oÃ¬     :Implicit input of string
 +                        :Append
  ò5                      :Partitions of length 5
     ®                    :Map
      Ô                   :   Reverse
       £                  :   Map each X
;       B                 :     Uppercase alphabet
         èX               :     Count occurrences of X
           Ã              :  End map
            Í             :  Convert from binary string to integer
             g            :  Index into
;             B           :    Uppercase alphabet
               ¬          :    Split
                c         :    Concatenate
                 6o       :    Range [0,6)
                   Ã      :End map
                    ¬     :Join

Jelly, 19 18 17 bytes
Ȯe€ØAs5UḄ‘ịØA;ØD¤

Try it online!
Explanation
Ȯe€ØAs5UḄ‘ịØA;ØD¤   Main monadic link
Ȯ                   Print (without newline)
  €                 Map:
 e                   is element of
   ØA                 the uppercase alphabet
     s              Split into chunks of
      5              five
       U            Reverse [each]
        Ḅ           Convert [each] from binary
         ‘          Add 1 [to each]
          ị         Lookup [each] by 1-based index in
                ¤   (
           ØA        the uppercase alphabet
             ;       join with
              ØD     digits 0-9
                ¤   )

-1 byte by inspiration from ovs' O5AB1E answer, printing the initial string directly instead of joining it at the end
-1 byts because I'm a dumb and didn't realize that U vectorizes

Perl, 80 bytes
$_.=join"",map{(A..Z,0..5)[oct"0b".join"",map{lc cmp$_}split//,reverse]}/.{5}/g

To be run as:
perl -ple '$_.=join"",map{(A..Z,0..5)[oct"0b".join"",map{lc cmp$_}split//,reverse]}/.{5}/g'

Pretty straightforward except lc cmp $_ and oct "0b" . $str for binary conversion.

Vyxal, 18 17 bytes
ƛꜝ;5ẇRvBkAkd+$İṅ+

Try it Online!
My first attempt at golfing in Vyxal.
Explanation
ƛꜝ;5ẇRvBkAkd+$İṅ+
ƛ ;                 Map
 ꜝ                    Is uppercase?
   5ẇ               Split into chunks of 5
     R              Reverse each
      v             Vectorize
       B              Convert from binary
        kAkd+       Push uppercase letters joined with digits
             $      Swap
              İ     Index
               ṅ    Join into a string
                +   Append to the original string

J, 36 bytes
,_5(u:@+22+43*<&26)@#.@|.\]~:tolower

Usage:
   (,_5(u:@+22+43*<&26)@#.@|.\]~:tolower) 'a0RE000000IJmcN'
a0RE000000IJmcNMAT

Try it online here.

Python 3, 87 bytes
lambda s:s+bytes(48+(17+sum((~s[i+j]&32)>>(5-i)for i in range(5)))%43 for j in(0,5,10))

Python 2, 97 bytes
lambda i:i+''.join(chr(48+(17+sum((2**j)*i[x+j].isupper()for j in range(5)))%43)for x in[0,5,10])

PowerShell, 162 bytes
function f{param($f)-join([char[]](65..90)+(0..5))[[convert]::ToInt32(-join($f|%{+($_-cmatch'[A-Z]')}),2)]}
($a=$args[0])+(f $a[4..0])+(f $a[9..5])+(f $a[14..10])

OK, a lot of neat stuff happening in this one. I'll start with the second line.
We take input as a string via $args[0] and set it to $a for use later. This is encapsulated in () so it's executed and the result returned (i.e., $a) so we can immediately string-concatenate it with the results of three function calls (f ...). Each function call passes as an argument the input string indexed in reverse order chunks as a char-array -- meaning, for the example input, $a[4..0] will equal @('0','E','R','0','a') with each entry as a char, not a string.
Now to the function, where the real meat of the program is. We take input as $f, but it's only used way toward the end, so let's focus there, first. Since it's passed as a char-array (thanks to our previous indexing), we can immediately pipe it into a loop with $f|%{...}. Inside the loop, we take each character and perform a case-sensitive regex match with -cmatch which will result in true/false if it's uppercase/otherwise. We cast that as an integer with the encapsulating +(), then that array of 1's and 0's is -joined to form a string. That is then passed as the first parameter in the .NET [convert]::ToInt32() call to change the binary (base 2) into decimal. We use that resultant decimal number to index into a string (-join(...)[...]). The string is first formulated as a range (65..90) that's cast as a char-array, then concatenated with the range (0..5) (i.e., the string is "ABCDEFGHIJKLMNOPQRSTUVWXYZ012345"). All of that is to return the appropriate character from the string.

C# 334
string g(string c){string[]b=new string[]{c.Substring(0,5),c.Substring(5, 5),c.Substring(10)};string o="",w="";for(int i=0,j=0;i<3;i++){char[]t=b[i].ToCharArray();Array.Reverse(t);b[i]=new string(t);o="";for(j=0;j<5;j++){o+=Char.IsUpper(b[i][j])?1:0;}int R=Convert.ToInt32(o,2);char U=R>26?(char)(R+22):(char)(R+65);w+=U;}return c+w;}

If requested, I'll reverse my code back to readable and post it.

C#, 171 bytes
I'm not really well-practiced in golfing C#, but here's a shot.
s=>{for(var u=s;u.Length>0;u=u.Substring(5)){int p=0,n=u.Substring(0,5).Select(t=>char.IsUpper(t)?1:0).Sum(i=>(int)(i*Math.Pow(2,p++)));s+=(char)(n+65-n/26*17);}return s;}

Suggestions: char.IsUpper(t) can be replaced with t>=65&t<=90 (& on bool in C# is basically a golf-shorter && without short-circuiting). 447 is shorter than 26*17. You don't need to do a separate Select: you can include the ternary directly within the Sum. Consider replacing all those usages of Substring with a loop based on Take instead, e.g. for(int i=0;i<3;i++)s.Skip(i*5).Take(5). For future reference, u!="" would be shorter than u.Length>0 (but that's no longer necessary if you're using Take).

The expression n/26*17 is not equivalent to n/442, but other than that, thanks for the suggestions. As stated, I'm not very experienced in golfing in C# so this is all great stuff for me to consider in the future.

Ah, sorry - I misread that.

Jolf, 30 bytes
Finally, a probably still-jolfable! Try it here!
+i mZci5d.p1CρA_Hpu1"[^1]'0"2
    Zci5                      split input into groups of 5
  _m                          map it
        d                      with this function
               _H              reverse H
              A  pu1            and replace in it all uppercase letters with 1
             ρ      "[^1]'0"    replace all non-ones with zeroes
            C               2   parse as binary integer
         .p1                    get the (^)th member of "A...Z0...9"

Python 3, 201 174 138 bytes
Big thanks to Trang Oul for pointing out a function declaration that no longer needed to exist. And Python ternary operators. And some incorrect output. Just...just give him the upvotes.
i=input();n='';c=l=15;
while c:c-=1;n+=('0','1')[i[c].isupper()]
while l:v=int(n[l-5:l],2);l-=5;i+=(chr(v+65),str(v-26))[v>25]
print(i)

You use function z() once, you can replace its call and save 25 bytes. Also, your code incorrectly assigns [ instead of 0.

Well, that was an embarrassing oversight on my part. Thanks.

You can save even more by replacing first if else with this construction and second one with ternary operator.

Husk, 26 bytes
S+öm!+…'A'Zṁsŀ6mȯ→ḋ↔†o±DC5

Try it online!
Getting the alphabets takes a lot of bytes. Otherwise, I think this qould be at par with the other languages.

05AB1E, 17 bytes
?5ôvžKuÙyR€.uJCè?

Try it online!
Commented:
?                 # print the input
 5ô               # split into groups of 5
   ε              # iterate over the groups:
    žK            #   push [a-zA-Z0-9]
      u           #   convert to uppercase
       Ù          #   deduplicate: [A-Z0-9]
        y         #   push the group
         R        #   reverse it
          €       #   for each char:
           .u     #     is it uppercase?
             J    #   join into a binary string
              C   #   convert from binary
               è  #   index into the string
                ? #   print the char at index

Raku, 63 bytes
{$_~S:g[((<:Lu>)||.)**5]=flat('A'..'Z',^6)[:2[?«$0[4…0;0]]]}

Try it online!

$_ is the single argument to this function, the Salesforce ID.
$_ ~ S:g[regex] = expr concatenates $_ with the result of globally replacing the regular expression regex with expr.
<:Lu> matches any uppercase letter.  (<:Lu>) || . matches an uppercase letter or any other character.  An uppercase letter will be stored in a capture group; other characters won't.
((<:Lu>) || .) ** 5 matches five such alternates.  $0 is the capture group for the outermost group.  Since it is repeated, it will be a list of match objects.  Each such match object will contain a capture group match object only if it's an uppercase letter.
As for the replacement text, flat('A'..'Z', ^6) evaluates to a list of all uppercase letters followed by the numbers zero through five.  The following bracketed expression is an index into that list, providing the replacement character for each set of five ID characters.
$0 is a list of match objects, one per character.
$0[4…0;0] is a list of the submatch objects, in reverse order.  For uppercase letters, this is a match object; for other characters, it's Nil.
?« coerces that list of objects to boolean values.  Match objects beome True, and Nil becomes False.
:2[...] combines those binary/boolean digits into a number.

K (ngn/k), 41 37 bytes
{x,,/[`c$65+!26;$!6]@2/|+3 5#~"A["'x}

Try it online!

~"A["'x generate a bit mask indicating which values of x (the input) are uppercase letters
|+3 5# chunk the input into five-length sections, transposing them and reversing the result to set up for...
2/ converting each column from a list of base-two values to a single base-ten number
,/[`c$65+!26;$!6]@ generate "ABCDEFGHIJKLMNOPQRSTUVWXYZ012345" and index into it with the above
x, append the checksum to the input (and implicitly return)

BQN, 40 bytesSBCS
{∾(u∾u-17)⊏˜2⊸×⊸+˜´¨(5/↕3)⊔∊u←'A'+↕26}

Run online!
Or 31 bytes in dzaima/BQN:
{∾(2⊸×⊸+˜´¨(5/↕3)⊔∊•a)⊏•a∾•d}

Dyalog APL, 23 bytes
{⍵,⎕A[1+2⊥⍉⎕A∊⍨⌽3 5⍴⍵]}

This is a straightforward mapping of the problem statement.
3 5⍴⍵ ⍝ Reshape the vector into a matrix of
      ⍝ 3 rows by 5 columns.
⌽     ⍝ Reverse the rows.
⎕A∊⍨  ⍝ For each element, check whether they
      ⍝ are a member(∊) of the uppercase
      ⍝ alphabet, ⎕A.
2⊥⍉   ⍝ Decode, ⊥, the columns as a base 2
      ⍝ number. The transpose, ⍉, is so the
      ⍝ rows becomes the columns. The result
      ⍝ is a three element vector.
1+    ⍝ Add one to each element so that they
      ⍝ map to the indexes of the letters on
      ⍝ the alphabet. This is because arrays
      ⍝ in APL are 1 indexed by default.
⎕A[]  ⍝ Maps the indexes to their
      ⍝ corresponding uppercase letter.
⍵,    ⍝ Finally concatenate the original
      ⍝ vector with the result.

Welcome to Code Golf!

Canvas, 31 bytes
５ｎ｛±｛┐Ｚ｛²≡］∑］２┴╵（Ｚ◂［］６＠）∑＠］⤢╶；＋

Try it here!

Perl 5 -p, 63 bytes
map{y/A-Z/0/c;y/A-Z/1/;$\.=(A..Z,0..5)[oct"0b".reverse]}/.{5}/g

Try it online!

Nibbles, 19 bytes (37 nibbles)
@   # The input
.   # Map
  `/ 5 @   # Split the input into chunks of 5
  =   # Index
    +   # Add
      `@2   # Convert from binary
        .   # Map
          \ $   # Reverse the argument of the outer map
          ,\ $ u   # Is the argument an uppercase letter?
      ~   # 1
    :   # Join
      + '@' ,26   # The uppercase alphabet
      +   # Concatenate
        .   # Map
          `, ~   # Numbers from 0
          `p   # Convert number to string

Stax, 16 15 bytes
ë"Y╚∙╘.b¢┘⌠:-\∩

Run and debug it

Thunno 2 j, 14 bytes
⁵ırfḅ2ḋkȦRUi;$

Try it online!
Explanation
⁵ırfḅ2ḋkȦRUi;$  # Implicit input
⁵               # Split into chunks of length 5
 ı          ;   # Map over each chunk:
  r             #  Reverse it
   f            #  Get the case of each character
                #   (1 = uppercase; 0 = lowercase;
                #    -1 = non-alphabetic)
    ḅ           #  Check for each if it equals 1
     2ḋ         #  Convert from a binary list
       kȦ       #  Push [a-zA-Z0-9]
         RU     #  Uppercase and uniquify
           i    #  Index into this string
             $  # Push the input
                # Implicit output of joined stack


text:
Counting orthogonal circulant matrices
Two rows of a matrix are orthogonal if their inner product equals zero. Call a matrix with all rows pairwise orthogonal an orthogonal matrix. A circulant matrix is one where each row vector is rotated one element to the right relative to the preceding row vector. We will only be interested in matrices where the entries are either -1 or 1.
Task
Write code to count as many different n/2 by n orthogonal, circulant matrices as possible in 2 minutes (for even n).
Input
The code has no input. It can try any even values of n it likes. For example, the code could try all n that are multiplies of 4 starting from the smallest and also try n = 2.
Output
The number of orthogonal circulant matrices you have found. There should also be a simple switch in your code to enable it to output the matrices themselves.
Score
The number of circulant matrices you have found.
Hints
Orthogonal n/2 by n circulant matrices only exist when n is a multiple of 4 or n is less than 4.
An example orthogonal circulant matrix is:
-1  1 -1 -1
-1 -1  1 -1

Tips for a naive approach
The most naive approach is just to iterate over all possible matrices. This can be sped up using the following two observations.

To test orthogonality of a circulant matrix we need only compare each row to the first one.  This is implemented in the sample code.
We can iterate over Lyndon words and then if we find an orthogonal matrix multiply by the number of possible rotations. This is idea as yet untested so may be buggy.

Sample code
This is a very simple and naive python answer. I ran it using timeout 120.
import itertools
def check_orthogonal(row):
    for i in xrange(1,int(n/2)):
        if (sum(row[j]*row[(j+i) % n] for j in xrange(n)) != 0):
            return False
    return True

counter = 0
for n in xrange(4,33,4):
    for row in itertools.product([-1,1],repeat = n):
        if check_orthogonal(row):
            counter +=1
            print "Counter is ", counter, ". n = ", n

Correctness tests
For n = 4,8,12,16,20,24,28, the number of distinct matrices you should get is 12,40,144,128,80,192,560, respectively.
Levels of awesomeness
Judging by the sample code, I hereby present two levels of awesomeness that any answer can aspire to achieve.

Silver level awesomeness is achieved by getting a score or 1156.
Gold level of awesomeness is to get higher than that.

Languages and libraries
You can use any language or library you like (that wasn't designed for this challenge). However, for the purposes of scoring I will run your code on my machine so please provide clear instructions for how to run it on Ubuntu.
My Machine The timings will be run on my machine. This is a standard Ubuntu install on an 8GB AMD FX-8350 Eight-Core Processor.  This also means I need to be able to run your code.
Leading answers

332 by flawr in Octave
404 by R.T. in Python
744 by Sample Solution using pypy
1156 by Thomas Kwa using Java. Silver level awesomeness!
1588 by Reimer Behrends in OCaml. Gold level awesomeness!

Can you actually find one for every n that is a multiple of four?

@flawr Now that's a great question! I have no idea but I would love to know.

From what I've seen now (if my script is correct) they seem to be pretty rare. As far as I know the circulant hadamard matrices (square matrices with entries in {-1,1}) are conjectured to exist only for n=1 and 4.

@flawr Yes on both counts (I wanted something that was rare to make the challenge interesting). But I am unaware of anything at all being known about n/2 by n circulant matrices.

Why are libraries for primality testing and factoring prohibited?

@feersum That was a copy and paste error! Fixed now.

I have a solution using bitmasking that I think will work for n=32.

@ThomasKwa That sounds great. If it finishes n=28 in time that would already be amazing.  However...Unfortunately there are no solutions for n=32 :)  I feel the Lyndon words idea should work and that would be fast enough to get somewhere with n=36 too.

@Lembik Really? That's too bad. n=28 finishes in about 10 seconds, and should be further optimizable, so I should be able to get through a small portion of n=36. I don't know if Lyndon words can be generared in less than ~1000 cycles each, which would be about the breakeven point.

OCaml, 1588 (n = 36)
This solution uses the usual bit pattern approach to represent vectors of -1s and 1s. The scalar product is as usual calculated by taking the xor of two bit vectors and subtracting n/2. Vectors are orthogonal iff their xor has exactly n/2 bits set.
Lyndon words are not per se useful as a normalized representation for this, as they exclude any pattern that is a rotation of itself. They are also relatively expensive to compute. Therefore, this code uses a somewhat simpler normal form, which requires that the longest consecutive sequence of zeroes after rotation (or one of them, if there are multiples) must occupy the most significant bits. It follows that the least significant bit is always 1.
Observe also that any candidate vector must have at least n/4 ones (and at most 3n/4). We therefore only consider vectors with n/4 ... n/2 bits set, since we can derive others via complement and rotation (in practice, all such vectors seem to have between n/2-2 and n/2+2 ones, but that seems to also be difficult to prove).
We build these normal forms from the least significant bit up, observing the constraint that any remaining runs of zeroes (called "gaps" in the code) must follow our normal form requirement. In particular, as long as at least one more 1-bit has to be placed, there must be room for the current gap and another than that is at least as big as the current gap or any other gap observed so far.
We also observe that the list of results is small. Therefore, we do not try to avoid duplicates during the discovery process, but simply record the results in per-worker sets and calculate the union of these sets at the end.
It is worth noting that the runtime cost of the algorithm still grows exponentially and at a rate that is comparable to that of the brute-force version; what this buys us is essentially a reduction by a constant factor, and comes at the cost of an algorithm that is more difficult to parallelize than the brute-force version.
Output for n up to 40:
 4: 12
 8: 40
12: 144
16: 128
20: 80
24: 192
28: 560
32: 0
36: 432
40: 640

The program is written in OCaml, to be compiled with:
ocamlopt -inline 100 -nodynlink -o orthcirc unix.cmxa bigarray.cmxa orthcirc.ml

Run ./orthcirc -help to see what options the program supports.
On architectures that support it, -fno-PIC may offer some small additional performance gain.
This is written for OCaml 4.02.3, but may also work with older versions (as long as they aren't too old).

UPDATE: This new version offers better parallelization. Note that it uses p * (n/4 + 1) worker threads per instance of the problem, and some of them will still run considerably shorter than others. The value of p must be a power of 2. The speedup on 4-8 cores is minimal (perhaps around 10%), but it scales better to a large number of cores for large n.
let max_n = ref 40
let min_n = ref 4
let seq_mode = ref false
let show_res = ref false
let fanout = ref 8

let bitcount16 n =
  let b2 n = match n land 3 with 0 -> 0 | 1 | 2 -> 1 | _ -> 2 in
  let b4 n = (b2 n) + (b2 (n lsr 2)) in
  let b8 n = (b4 n) + (b4 (n lsr 4)) in
  (b8 n) + (b8 (n lsr 8))

let bitcount_data =
  let open Bigarray in
  let tmp = Array1.create int8_signed c_layout 65536 in
    for i = 0 to 65535 do
      Array1.set tmp i (bitcount16 i)
    done;
    tmp

let bitcount n =
  let open Bigarray in
  let bc n = Array1.unsafe_get bitcount_data (n land 65535) in
  (bc n) + (bc (n lsr 16)) + (bc (n lsr 32)) + (bc (n lsr 48))

module IntSet = Set.Make (struct
  type t = int
  let compare = Pervasives.compare
end)

let worker_results = ref IntSet.empty

let test_row vec row mask n =
  bitcount ((vec lxor (vec lsr row) lxor (vec lsl (n-row))) land mask) * 2 = n

let record vec len n =
  let m = (1 lsl n) - 1 in
  let rec test_orth_circ ?(row=2) vec m n =
    if 2 * row >= n then true
    else if not (test_row vec row m n) then false
    else test_orth_circ ~row:(row+1) vec m n
  in if test_row vec 1 m n &&
        test_orth_circ vec m n then
  begin
    for i = 0 to n - 1 do
      let v = ((vec lsr i) lor (vec lsl (n - i))) land m in
      worker_results := IntSet.add v !worker_results;
      worker_results := IntSet.add (v lxor m) !worker_results
    done
  end

let show vec n =
  for i = 0 to n / 2 - 1 do
    let vec' = (vec lsr i) lor (vec lsl (n - i)) in
    for j = 0 to n-1 do
      match (vec' lsr (n-j)) land 1 with
      | 0 -> Printf.printf "  1"
      | _ -> Printf.printf " -1"
    done; Printf.printf "\n"
  done; Printf.printf "\n"; flush stdout

let rec build_normalized ~prefix ~plen ~gap ~maxgap ~maxlen ~bits ~fn =
  if bits = 0 then
    fn prefix plen maxlen
  else begin
    let room = maxlen - gap - plen - bits in
    if room >= gap && room >= maxgap then begin
      build_normalized
        ~prefix:(prefix lor (1 lsl (plen + gap)))
        ~plen:(plen + gap + 1)
        ~gap:0
        ~maxgap:(if gap > maxgap then gap else maxgap)
        ~maxlen
        ~bits:(bits - 1)
        ~fn;
      if room > gap + 1 && room > maxgap then
        build_normalized ~prefix ~plen ~gap:(gap + 1) ~maxgap ~maxlen ~bits ~fn
    end
  end

let rec log2 = function
| 0 -> -1
| n -> 1 + (log2 (n lsr 1))

let rec test_gap n pat =
  if n land pat = 0 then true
  else if pat land 1 = 0 then test_gap n (pat lsr 1)
  else false

let rec test_gaps n maxlen len =
  let fill k = (1 lsl k) -1 in
  if len = 0 then []
  else if test_gap n ((fill maxlen) lxor (fill (maxlen-len))) then
    len :: (test_gaps n maxlen (len-1))
  else test_gaps n maxlen (len-1)

let rec longest_gap n len =
  List.fold_left max 0 (test_gaps n len len)

let start_search low lowbits maxlen bits fn =
  let bits = bits - (bitcount low) in
  let plen = log2 low + 1 in
  let gap = lowbits - plen in
  let maxgap = longest_gap low lowbits in
  worker_results := IntSet.empty;
  if bits >= 0 then
    build_normalized ~prefix:low ~plen ~gap ~maxgap ~maxlen ~bits ~fn;
  !worker_results

let spawn f x =
  let open Unix in
  let safe_fork () = try fork() with _ -> -1 in
  let input, output = pipe () in
  let pid = if !seq_mode then -1 else safe_fork() in
  match pid with
  | -1 -> (* seq_mode selected or fork() failed *)
     close input; close output; (fun () -> f x)
  | 0 -> (* child process *)
    close input;
    let to_parent = out_channel_of_descr output in
    Marshal.to_channel to_parent (f x) [];
    close_out to_parent; exit 0
  | pid -> (* parent process *)
    close output;
    let from_child = in_channel_of_descr input in
    (fun () ->
      ignore (waitpid [] pid);
      let result = Marshal.from_channel from_child in
      close_in from_child; result)

let worker1 (n, k) =
  start_search 1 1 n k record

let worker2 (n, k, p) =
  start_search (p * 2 + 1) (log2 !fanout + 1) n k record

let spawn_workers n =
  let queue = Queue.create () in
  if n = 4 || n = 8 then begin
    for i = n / 4 to n / 2 do
      Queue.add (spawn worker1 (n, i)) queue
    done
  end else begin
    for i = n / 2 downto n / 4 do
      for p = 0 to !fanout - 1 do
        Queue.add (spawn worker2 (n, i, p)) queue
      done
    done
  end;
  Queue.fold (fun acc w -> IntSet.union acc (w())) IntSet.empty queue

let main () =
  if !max_n > 60 then begin
    print_endline "error: cannot handle n > 60";
    exit 1
  end;
  min_n := max !min_n 4;
  if bitcount !fanout <> 1 then begin
    print_endline "error: number of threads must be a power of 2";
    exit 1;
  end;
  for n = !min_n to !max_n do
    if n mod 4 = 0 then
    let result = spawn_workers n in
    Printf.printf "%2d: %d\n" n (IntSet.cardinal result);
    if !show_res then
      IntSet.iter (fun v -> show v n) result;
    flush stdout
  done

let () =
  let args =[("-m", Arg.Set_int min_n, "min size of the n by n/2 matrix");
             ("-n", Arg.Set_int max_n, "max size of the n by n/2 matrix");
             ("-p", Arg.Set_int fanout, "parallel fanout");
             ("-seq", Arg.Set seq_mode, "run in single-threaded mode");
             ("-show", Arg.Set show_res, "display list of results") ] in
  let usage = ("Usage: " ^
               (Filename.basename Sys.argv.(0)) ^
               " [-n size] [-seq] [-show]") in
  let error _ = Arg.usage args usage; exit 1 in
  Arg.parse args error usage;
  main ()

This is great and welcome back! Having said that... how about a Nim answer too? :)

Your code only gets to 36: 432 on my machine in time.

Huh. It runs to 40 in just under two minutes on my laptop with a quadcore processor (2.5GHz Intel Core i7), so I was fairly confident it would make it to 40 on yours, too. I'll update accordingly. About your other question, while I have a brute-force Nim implementation, that one still runs twice as slow (because of the brute-force part) and isn't too different from Thomas Kwa's code (just a bit more reduction of the search space), so it's not like you're missing anything exciting.

Am I right that your code needs a 64 bit system? I just tested it on a 32 bit one where it always outputs 0.

Correct, as it stores the vectors as ints. I could also force a 64-bit representation (or even big integers), but that would be enormously slower on a 32-bit system.

Just a note that it turns out there are in fact an infinite number of matrices. However, it's not at all clear how to construct them! http://math.stackexchange.com/questions/1617517/explicit-construction-of-n-2-by-n-circulant-partial-hadamard-matrices

The first version of your code took just over 4 minutes and this new version just over 3. That's an impressive improvement!

It's just better parallelization, the algorithm is the same. It may be giving you a better speedup because you actually have eight separate cores while my computer has four hyperthreaded ones. The old version did tail off into running just a small number of processes at the same time, while the new version distributes the load more evenly across workers (I mostly wrote it so that I could throw it at 64 cores without wasting most of them). That said, I'm still baffled why it runs quite a bit faster on my seemingly weaker laptop.

Java, 1156 matrices
This uses fairly naive bitmasking, and takes under 15 seconds for n=28 on my machine.
Circulant matrices are determined by their first rows. Therefore, I represent the first rows of the matrices as bit vectors: 1 and 0 represent -1 and 1. Two rows are orthogonal when the number of set bits when they're xor'd together is n/2.
import java.util.Arrays;

class Main {

    static void dispmatrix(long y,int N)
    {
        int[][] arr = new int[N/2][N];
        for(int row=0; row < N/2; row++)
        {
            for(int col=0; col < N; col++)
            {
                arr[row][col] = (int) ((y >>> (N+row-col)) & 1L);
            }
        }
        System.out.println(Arrays.deepToString(arr));
    }

  public static void main(String[] args) {

    int count = 0;
    boolean good;
    boolean display = false;
    long y;
    for(int N=4; N <= 28 ;N += 4)
    {
    long mask = (1L << N) - 1;
    for(long x=0; x < (1L<<N); x++)
    {
        good = true;
        y = x + (x << N);

        for(int row = 1; row < N/2; row++)
        {
            good &= N/2 == Long.bitCount((y ^ (y >>> row)) & mask);
        }

        if(good)
        {
            if(display) dispmatrix(y,N);
            count++;
        }

    }
    System.out.println(count);
    }
  }
}

I can't get Eclipse to work right now, so this was tested on repl.it.
Here are the number of first rows that are orthogonal to the first r rows afterwards for n=28:
[268435456, 80233200, 23557248, 7060320, 2083424, 640304, 177408, 53088, 14896, 4144, 2128, 1008, 1008, 560]

Optimizations:

Since orthogonality doesn't change with a cyclic rotation of both rows, we just need to check that the first row is orthogonal to the rest.
Rather than manually do an N-bit cyclic shift N/2 times, I store the bits to be shifted in at the top of the long, and then use a single and with the lower N bits to extract the needed ones.

Possible further optimizations:

Generate Lyndon words. According to my calculations this only makes sense if Lyndon words can be generated in less than ~1000 cycles each.
If Lyndon words take too long, we can still only check the bit vectors that start in 00, and use their rotations (and rotations of the NOT) when we find an orthogonal matrix. We can do this because 0101...01 and 1010...10 are not possible first rows, and all the others contain either a 00 or a 11.
Branch maybe halfway through when the matrix is probably orthogonal. I don't know how much branching will cost, though, so I'll need to test.
If the above works, start with a row other than row 1?
Maybe there's some mathematical way to eliminate some possibilities. I don't know what that would be.
Write in C++, of course.

This is great. Thank you! I look forward to some of your optimizations so we can see numbers for n=36 too .

Oh and you reached Silver level awesomeness! :)

Python (404 matrices on i5-5300U)
Mainly posting this as a starting point for others to improve on, this can be cleaned up a lot, parallelized, etc.
import numpy
import itertools
import time

def findCirculantOrthogonalRows(n, t1, timeLimit):
  validRows = []
  testMatrix = numpy.zeros((n//2, n))
  identityMatrixScaled = n*numpy.identity(n//2)
  outOfTime = False
  for startingRowTuple in itertools.product([1, -1], repeat=n):
     for offset in range(n//2):
       for index in range(n):
         testMatrix[offset][index] = startingRowTuple[(index-offset) % n]

     if(numpy.array_equal(identityMatrixScaled, testMatrix.dot(testMatrix.transpose()))):
      validRows.append(startingRowTuple)

    if(time.clock() - t1 >= timeLimit):
      outOfTime = True
      break

  return (validRows, outOfTime)

n = 4
validFirstRows = []
t1 = time.clock()
timeLimit = 120
fullOutput = True

while(True):
  print('calling with', n)
  (moreRows, outOfTime) = findCirculantOrthogonalRows(n, t1, timeLimit)

  if(len(moreRows) > 0):
    validFirstRows.extend(moreRows)

  if(outOfTime == True):
    break

  n += 4

print('Found', len(validFirstRows), 'circulant orthogonal matrices in', timeLimit, 'seconds')

if(fullOutput):
  counter = 1
  for r in validFirstRows:
    n = len(r)
    matrix = numpy.zeros((n//2, n))
    for offset in range(n//2):
      for index in range(n):
        matrix[offset][index] = r[(index-offset) % n]
    print('matrix #', counter, ':\n', matrix)
    counter += 1
    input()

I added some sample code. The first obvious improvement is to iterate over Lyndon words but I am not sure how to code that.

Matlab/Octave, 381 / 328 matrices
Also just the naive approach, trying every possible combination.
counter = 0;
%ok: 2,4,8
%none:
tic
for n=[2,4,8,12,16,20];
    m=n/2;
    N=2^n-1;
    for k=1:N

        k/N; %remove ; in order to see progress
        v=(dec2bin(k,n)-'0')*2-1;               %first row

        z=toeplitz([v(1) fliplr(v(m+2:n))], v); %create circulante matrix
        w = z * z.';
        if norm(w - diag(diag(w))) < eps
            counter = counter+1;
            %n    %remove % in order to see the matrices
            %z
        end
        if toc>120;
            break;
        end
    end
end
counter

In octave the code prints a huge amount to the screen which might be slowing it down. "ans = ...."

Oh right, I forgot to add that: The most indented lines there is an n and a z, these two can be commented out with a single %. And then you can add a ; after the counter = counter+1 and the k/N  which will suppress the output.

Matlab, 431 matrices
Adjusted from @flawr's answer, using Parallel Pool technique

Number of Parallel Pool workers: 6
CPU: Intel(R) Core(TM) i7-10750H CPU @2.60GHz
Memory: 16.0 GB

% Turn off the unnecessary warnings
warning('off', 'MATLAB:nearlySingularMatrix')

counter = 0;
main_timer = tic;

% Define the loop indices
loop_indices = [2,4,8,12,16,20,24,28,32,36,40,44,48,52,56,60];

% Use parfor instead of for to enable parallel computing
% Requires Parallel Computing Toolbox
parfor idx = 1:length(loop_indices)
    n = loop_indices(idx);
    m = n / 2;
    N = 2^n - 1;

    for k = 1:N
        % Use toc with the main_timer to get elapsed time
        if toc(main_timer) > 120
            break;
        end

        % Use built-in de2bi function for better performance
        v = (de2bi(k, n, 'left-msb') * 2) - 1;

        z = toeplitz([v(1) fliplr(v(m+2:n))], v);
        w = z * z.';

        % Use normest for faster estimation of matrix norm
        if normest(w - diag(diag(w))) < eps
            counter = counter + 1;
        end
    end
end

counter

source: Stack Exchange

license: 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/

sort: votes


text:
Base Conversion With Strings
Introduction
We've have a few base conversion challenges here in the past, but not many designed to tackle arbitrary length numbers (that is to say, numbers that are long enough that they overflow the integer datatype), and of those, most felt a little complicated. I'm curious how golfed down a change of base code like this can get.
Challenge
Write a program or function in the language of your choice that can convert a string of one base to a string of another base. Input should be the number to be converted (string), from-base (base-10 number), to-base (base-10 number), and the character set (string). Output should be the converted number (string).
Some further details and rules are as follows:

The number to be converted will be a non-negative integer (since - and . may be in the character set). So too will be the output.
Leading zeroes (the first character in the character set) should be trimmed. If the result is zero, a single zero digit should remain.
The minimum supported base range is from 2 to 95, consisting of the printable ascii characters.
The input for the number to be converted, the character set, and the output must all be of the string datatype. The bases must be of the base-10 integer datatype (or integer floats).
The length of the input number string can be very large. It's hard to quantify a sensible minimum, but expect it to be able to handle at least 1000 characters, and complete 100 characters input in less than 10 seconds on a decent machine (very generous for this sort of problem, but I don't want speed to be the focus).
You cannot use built in change-of-base functions.
The character set input can be in any arrangement, not just the typical 0-9a-z...etc.
Assume that only valid input will be used. Don't worry about error handling.

The winner will be determined by the shortest code that accomplishes the criteria. They will be selected in at least 7 base-10 days, or if/when there have been enough submissions. In the event of a tie, the code that runs faster will be the winner. If close enough in speed/performance, the answer that came earlier wins.
Examples
Here's a few examples of input and output that your code should be able to handle:
F("1010101", 2, 10, "0123456789")
> 85

F("0001010101", 2, 10, "0123456789")
> 85

F("85", 10, 2, "0123456789")
> 1010101

F("1010101", 10, 2, "0123456789")
> 11110110100110110101

F("bababab", 2, 10, "abcdefghij")
> if

F("10", 3, 2, "0123456789")
> 11

F("<('.'<)(v'.'v)(>'.'>)(^'.'^)", 31, 2, "~!@#$%^v&*()_+-=`[]{}|';:,./<>? ")
> !!~~~~~~~!!!~!~~!!!!!!!!!~~!!~!!!!!!~~!~!~!!!~!~!~!!~~!!!~!~~!!~!!~~!~!!~~!!~!~!!!~~~~!!!!!!!!!!!!~!!~!~!~~~~!~~~~!~~~~~!~~!!~~~!~!~!!!~!~~

F("~~~~~~~~~~", 31, 2, "~!@#$%^v&*()_+-=`[]{}|';:,./<>? ")
> ~

F("9876543210123456789", 10, 36, "0123456789abcdefghijklmnopqrstuvwxyz")
> 231ceddo6msr9

F("ALLYOURBASEAREBELONGTOUS", 62, 10, "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")
> 6173180047113843154028210391227718305282902

F("howmuchwoodcouldawoodchuckchuckifawoodchuckcouldchuckwood", 36, 95, "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ~`!@#$%^&*()_-+=[{]}\\|;:'\",<.>/? ")
> o3K9e(r_lgal0$;?w0[`<$n~</SUk(r#9W@."0&}_2?[n

F("1100111100011010101010101011001111011010101101001111101000000001010010100101111110000010001001111100000001011000000001001101110101", 2, 95, "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ~`!@#$%^&*()_-+=[{]}\\|;:'\",<.>/? ")
> this is much shorter

We have had one designed to tackle arbitrary length numbers.

@PeterTaylor Well dang, somehow missed that one in my search. Still, I would argue they are different enough. The other one involves a default character set, multi-byte sequences, error handling, and sequence-to-sequence conversion. All these add to much larger bloat in the answers, and focus on different optimizations. This challenge is much more trimmed down, and will result in completely different code from the other challenge (short of the core algorithm).

@PeterTaylor Plus, the other question was asked 4 years ago and received only two valid answers (and with one already accepted, little reason to bump). I'm willing to bet the community would enjoy this challenge, with little impact from the previous one, or feelings of "repetitiveness".

While this challenge is very similar to the previous one, I'd actually be in favor of closing the previous one as a dupe of this one. This challenge is much clearer and higher quality than the old one.

Could you elaborate a bit on You cannot use built in change-of-base functions to convert the entire input string/number at once? Specifically, could I use a built-in to convert the input to a intermediate base? Can I then use a built-in to convert to the target base? Would something like convert input with canonical form for given base; convert to base 10; convert to target base; convert back to specified character set with string replacement?

Now that this question has an answer, I have voted to close the older one as a dupe of this one.

"7 base-10 days"  I guess since this thing uses arbitrary characters as digits, "7" could stand for any number. For instance, if the character set is the ASCII characters from code 46 to code 55, then this challenge will end in 10 days. On the other hand, if using the standard digits, why specify a base? The symbol 7 represents the number 7 in any base that uses it.

@Mego Good point on the base conversion loophole. It'd probably be simpler to just say no built-in base change at all, especially since no answers use it yet.

@quintopia It was really more a self reference to a previous challenge I made, from which I copied the post template for this one, as well as a reference to the challenge itself and bases. For that matter, isn't "base-10" indeterminate itself, since every base has a 10? ;)

@Mwr247 clearly you meant "standard-digit 7 days" or "standard-digit 7 base-standard-digit-A days" which is redundant with the former.

There's no such thing as a base-10 integer datatype. Just say input will be in base ten.

@ThomasKwa But then someone might try a base-10 string ;)

CJam, 34 bytes
0ll:Af#lif{@*+}~li:X;{XmdA=\}h;]W%

Input format is input_N alphabet input_B output_B each on a separate line.
Run all test cases.
Explanation
0     e# Push a zero which we'll use as a running total to build up the input number.
l     e# Read the input number.
l:A   e# Read the alphabet and store it in A.
f#    e# For each character in the input number turn it into its position in the alphabet,
      e# replacing characters with the corresponding numerical digit value.
li    e# Read input and convert to integer.
f{    e# For each digit (leaving the base on the stack)...
  @*  e#   Pull up the running total and multiply it by the base.
  +   e#   Add the current digit.
}
~     e# The result will be wrapped in an array. Unwrap it.
li:X; e# Read the output base, store it in X and discard it.
{     e# While the running total is not zero yet...
  Xmd e#   Take the running total divmod X. The modulo gives the next digit, and
      e#   the division result represents the remaining digits.
  A=  e#   Pick the corresponding character from the alphabet.
  \   e#   Swap the digit with the remaining value.
}h
;     e# We'll end up with a final zero on the stack which we don't want. Discard it.
]W%   e# Wrap everything in an array and reverse it, because we've generated the
      e# digits from least to most significant.

This works for the same byte count:
L0ll:Af#lif{@*+}~li:X;{XmdA=@+\}h;

The only difference is that we're building up a string instead of collecting everything on the stack and reversing it.

Seriously, 50 bytes
0╗,╝,2┐,3┐,4┐╛`4└í╜2└*+╗`MX╜ε╗W;3└@%4└E╜@+╗3└@\WX╜

Hex Dump:
30bb2cbc2c32bf2c33bf2c34bfbe6034c0a1bd32c02a2bbb60
4d58bdeebb573b33c0402534c045bd402bbb33c0405c5758bd

I'm proud of this one despite its length. Why? Because it worked perfectly on the second try. I wrote it and debugged it in literally 10 minutes. Usually debugging a Seriously program is an hour's labor.
Explanation:
0╗                                                  Put a zero in reg0 (build number here)
  ,╝,2┐,3┐,4┐                                       Put evaluated inputs in next four regs
             ╛                                      Load string from reg1
              `         `M                          Map over its chars
               4└                                   Load string of digits
                 í                                  Get index of char in it.
                  ╜                                 Load number-so-far from reg0
                   2└*                              Multiply by from-base
                      +                             Add current digit.
                       ╗                            Save back in reg0
                          X                         Discard emptied string/list.
                           ╜                        Load completed num from reg0
                            ε╗                      Put empty string in reg0
                              W                W    While number is positive
                               ;                    Duplicate
                                3└@%                Mod by to-base.
                                    4└E             Look up corresponding char in digits
                                       ╜@+          Prepend to string-so-far.
                                                      (Forgetting this @ was my one bug.)
                                          ╗         Put it back in reg0
                                           3└@\     integer divide by to-base.
                                                X   Discard leftover 0
                                                 ╜  Load completed string from reg0
                                                    Implicit output.

I think this answer lacks specifying the language and explaining how it works. (what is the hexdump about?).

@BitTickler The language is exactly as stated in the header: Seriously. The explanation of how it works is exactly as in the box at the bottom. The hex dump was for length confirmation purposes related to technical limitations on this website at the time I posted it.

Python 2, 115 114 106 105 94 bytes
Golfing suggestions welcome. Try it online!
Edit: -9 bytes thanks to mbomb007. -2 bytes thanks to FlipTack.
def a(n,f,t,d,z=0,s=''):
 for i in n:z=z*f+d.find(i)
 while z:s=d[z%t]+s;z/=t
 print s or d[0]

Ungolfed:
def arbitrary_base_conversion(num, b_from, b_to, digs, z=0, s=''):
    for i in num:
        z = z * b_from + digs.index(i)
    while z:
        s = digs[z % b_to] + s
        z = z / t
    if s:
        return s
    else:
        return d[0]

while z:s=d[z%t]+s;z/=t saves 9 bytes.

You could put z=0 and s='' in the function declaration to save bytes.

using print instead of return is allowed by default.

Ruby, 113 112 105 98 97 95 87 bytes
I sort of double-posted my Python answer (somehow), so here's a Ruby answer. Seven more bytes thanks to manatwork, another byte thanks to Martin Büttner, and 8 more bytes thanks to cia_rana.
->n,f,t,d{z=0;s='';n.chars{|i|z=z*f+d.index(i)};(s=d[z%t]+s;z/=t)while z>0;s[0]?s:d[0]}

Ungolfed:
def a(n,f,t,d)
  z=0
  s=''
  n.chars do |i|
    z = z*f + d.index(i)
  end
  while z>0
    s = d[z%t] + s
    z /= t
  end
  if s[0]   # if n not zero
    return s
  else
    return d[0]
  end
end

How about use s=d[z%t]+s;z/=t instead of z,m=z.divmod t;s=d[m]+s?

You can save 2 bytes by using numbered parameter _1 instead of |i| in Ruby 2.7+

C (function) with GMP library, 260
This turned out longer than I'd hoped, but here it is anyway.  The mpz_* stuff really eats up a lot of bytes.  I tried #define M(x) mpz_##x, but that gave a net gain of 10 bytes.
#include <gmp.h>
O(mpz_t N,int t,char*d){mpz_t Q,R;mpz_inits(Q,R,0);mpz_tdiv_qr_ui(Q,R,N,t);mpz_sgn(Q)&&O(Q,t,d);putchar(d[mpz_get_ui(R)]);}F(char*n,int f,int t,char*d){mpz_t N;mpz_init(N);while(*n)mpz_mul_ui(N,N,f),mpz_add_ui(N,N,strchr(d,*n++)-d);O(N,t,d);}

The function F() is the entry-point.  It converts the input string to an mpz_t by successive multiplications by the from-base and addition of the index of the given digit in the digit list.
The function O() is a recursive output function.  Each recursion divmods the mpz_t by the to-base.  Because this yields the output digits in reverse order, the recursion effectively allows the digits to be stored on the stack and output in the correct order.
Test driver:
Newlines and indenting added for readability.
#include <stdio.h>
#include <string.h>

#include <gmp.h>
O(mpz_t N,int t,char*d){
  mpz_t Q,R;
  mpz_inits(Q,R,0);
  mpz_tdiv_qr_ui(Q,R,N,t);
  mpz_sgn(Q)&&O(Q,t,d);
  putchar(d[mpz_get_ui(R)]);
}
F(char*n,int f,int t,char*d){
  mpz_t N;
  mpz_init(N);
  while(*n)
    mpz_mul_ui(N,N,f),mpz_add_ui(N,N,strchr(d,*n++)-d);
  O(N,t,d);
}

int main (int argc, char **argv) {
  int i;

  struct test_t {
    char *n;
    int from_base;
    int to_base;
    char *digit_list;
  } test[] = {
    {"1010101", 2, 10, "0123456789"},
    {"0001010101", 2, 10, "0123456789"},
    {"85", 10, 2, "0123456789"},
    {"1010101", 10, 2, "0123456789"},
    {"bababab", 2, 10, "abcdefghij"},
    {"10", 3, 2, "0123456789"},
    {"<('.'<)(v'.'v)(>'.'>)(^'.'^)", 31, 2, "~!@#$%^v&*()_+-=`[]{}|';:,./<>? "},
    {"~~~~~~~~~~", 31, 2, "~!@#$%^v&*()_+-=`[]{}|';:,./<>? "},
    {"9876543210123456789", 10, 36, "0123456789abcdefghijklmnopqrstuvwxyz"},
    {"ALLYOURBASEAREBELONGTOUS", 62, 10, "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"},
    {"howmuchwoodcouldawoodchuckchuckifawoodchuckcouldchuckwood", 36, 95, "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ~`!@#$%^&*()_-+=[{]}\\|;:'\",<.>/? "},
    {"1100111100011010101010101011001111011010101101001111101000000001010010100101111110000010001001111100000001011000000001001101110101", 2, 95, "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ~`!@#$%^&*()_-+=[{]}\\|;:'\",<.>/? "},
    {0}
  };

  for (i = 0; test[i].n; i++) {
    F(test[i].n, test[i].from_base, test[i].to_base, test[i].digit_list);
    puts("");
  }

  return 0;
}

JavaScript (ES6), 140 bytes
(s,f,t,m)=>[...s].map(c=>{c=m.indexOf(c);for(i=0;c||i<r.length;i++)r[i]=(n=(r[i]|0)*f+c)%t,c=n/t|0},r=[0])&&r.reverse().map(c=>m[c]).join``

Unlike @Mwr247's code (which uses base-f arithmetic to divide s by t each time, collecting each remainder as he goes) I use base-t arithmetic to multiply the answer by f each time, adding each digit of s as I go.
Ungolfed:
function base(source, from, to, mapping) {
    result = [0];
    for (j = 0; j < s.length; s++) {
        carry = mapping.indexOf(s[j]);
        for (i = 0; carry || i < result.length; i++) {
            next = (result[i] || 0) * from + carry;
            result[i] = next % to;
            carry = Math.floor(next / to);
         }
    }
    string = "";
    for (j = result.length; j --> 0; )
        string += mapping[result[j]];
    return string;
}

APL, 10 bytes
{⍺⍺[⍵⍵⍳⍵]}

This is an APL operator. In APL, ⍵ and ⍺ are used to pass values, while ⍵⍵ and ⍺⍺ are usually used to pass functions. I'm abusing this here to have 3 arguments. ⍺⍺ is the left argument, ⍵⍵ is the "inner" right argument, and ⍵ is the "outer" right argument.
Basically: ⍺(⍺⍺{...}⍵⍵)⍵
Then all that's needed is ⍳ to find the positions of the input string in the "from" table, and then use [] to index into the "to" table with these positions.
Example:
    ('012345'{⍺⍺[⍵⍵⍳⍵]}'abcdef')'abcabc'
012012

JavaScript (ES6), 175 bytes
(s,f,t,h)=>eval('s=[...s].map(a=>h.indexOf(a));n=[];while(s.length){d=m=[],s.map(v=>((e=(c=v+m*f)/t|0,m=c%t),e||d.length?d.push(e):0)),s=d,n.unshift(m)}n.map(a=>h[a]).join``')

Figured it's been long enough now that I can submit the one I made to create the examples. I may try and golf it down a bit better later.

Japt, 9 bytes
nVîX
sWîX

Try it

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


text:
Find ranges of True values in a list
Challenge:
Write a function or program that accepts a list of boolean values and returns all of the ranges of True's.
Test Cases:
f [F]                               = []
f [T]                               = [[0,0]]
f [T,T,F,T]                         = [[0,1],[3,3]]
f [F,T,T,F,F,T,T,T]                 = [[1,2],[5,7]]
f [F,T,T,F,F,F,T,T,T,T]             = [[1,2],[6,9]]
f [T,T,F,F,F,T,T,T,T,T,T,T,T,T,T,F] = [[0,1],[5,14]]
f [F,F,T,T,F,F,F,F,F,F,F,F,T,T,T,T,T,T,T,T,F,F,F,F,F,F,F,F,F,F,F,F,F,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,T,T] = [[2,3],[12,19],[33,54],[93,94]]

Rules:

You may choose how input is encoded, e.g. a list, array, string, etc.
The output must be encoded as a list-like of list-likes or a string showing such, so arrays, lists, tuples, matrices, vectors, etc.
The boolean values must be encoded as constants, but otherwise any simple conversion of T/F to desired constants is allowed
EDIT: eval or similar during runtime IS allowed.
Don't to forget to explain how input is passed to the program/function and give its input/output for the test cases
Conversion to desired input format not counted
Standard loopholes are disallowed
If your language has a function to do this, it's not allowed
I will not accept my own submission
EDIT: Output format is flexible. If not printing a list or similar, range values must be separated by one non-numeric character and separate ranges as well.

Scoring:

Score is in bytes, unless unfit to your language (such as codels in Piet)
Lowest score wins

There's a good bit of flexibility in input and output, but solutions where T/F are replaced with functions that do all the work are disallowed.
Debugging:
If you write yours in Haskell or can call it from Haskell, the following will check your function/program:
import Test.QuickCheck

tf = cycle [True,False]
gen l = foldl (++) [] $ map (\i -> [tf!!i | x<-[1..i]]) l
putIn (a,b) l = zipWith (||) l [(a <= p) && (p <= b) | p <- [0..length l]]
putAllIn rs len = foldr putIn [False|i<-[1..len]] rs
main = print $ quickCheck (check functionNameGoesHere)

I may be missing something, but I don't see a description of how a range is represented in the output.

Can the output be 1-indexed?

Can the ranges be half-exclusive?

@LegionMammal978 Only if your language default is 1-indexed, for example Mathematica

@ThomasKwa Nope, that seems too different for "edge" cases

Can the output be 0-indexed if the language is 1-indexed? [Edit: Turns out I don't need it anyway, but someone else might.]

Pyth, 17 16 bytes
fT.b*Y,~+ZNtZrQ8

Uses some fancy post-assign counter magic together with run length encoding.
Takes input as an array of 0s and 1s, e.g. [1, 1, 0, 1, 0]. Outputs like in the challenge, e.g. [[0, 1], [3, 3]].
Test Suite

I added a test suite. If the edit is approved and no one snipes, you have the shortest valid answer.

Pyth, 18 bytes
CxR.:++~Zkz02_B_`T

Test suite
True is represented as 1, False as 0.
Ranges are represented inclusively.

Can you add an explanation?

Sure, sometime else.

spoiler alert - it's been 5 years and he never posted it

Retina, 82 34 27 bytes
\b(?<=(.)*_?)
$#1
_+

S_`:

The empty line should contain a single space.
Input is a flat string of _ for true and : for false. Output is space-separated pairs, each on a separate line.
Try it online.
Explanation
The heavy golfing from 82 down to 27 bytes was possible by clever choice of the representation of true and false. I've picked a word character, _, (that isn't a digit) for true and a non-word character, :, (that doesn't need escaping) for false. That allows me to detect the ends of ranges as word boundaries.
\b(?<=(.)*_?)
$#1

We match a word boundary. We want to replace that boundary with the corresponding index of the truthy value. In principle that is quite easy with Retina's recent $# feature, which counts the number of captures of a group. We simply capture each character in front of that position into a group. By counting those characters we get the position. The only catch is that the ends of the range are off by one now. We actually want the index of the character in front the match. That is also easily fixed by optionally matching a _ which isn't captured, thereby skipping one character when we're at the end of a range.
_+
<space>

Now we replace all runs of underscores with a space. That is, we insert a space between the beginning and end of each range, while getting rid of the underscores.
S_`:

That leaves the colons (and we still need to separate pairs). We do that by splitting the entire string into lines around each colon. The S actives split mode, and the _ suppresses empty segments such that don't get tons of empty lines when we have runs of colons.

MATL, 17 18 20 bytes
j'T+'1X32X34$2#XX

Uses current version (9.1.0) of the language/compiler.
Input is a string containing characters T and F. Output is a two-row table, where each column indicates a range using 1-indexing, which is the language default.
Thanks to Stewie Griffin for removing 2 bytes.
Example
>> matl
 > j'T+'1X32X34$2#XX
 >
> FTTFFFTTTT
2 7
3 10

Explanation
It's based on a simple regular expression:
j         % input string
'T+'      % regular expression: match one or more `T` in a row
1X3       % predefined string literal: 'start'
2X3       % predefined string literal: 'end'
4$2#XX    % regexp with 4 inputs (all the above) and 2 outputs (start and end indices)
          % implicitly display start and end indices

Python 2, 69 bytes
p=i=0
for x in input()+[0]:
 if x-p:b=x<p;print`i-b`+';'*b,
 p=x;i+=1

Example output:
2 3; 7 16; 18 18;

A direct approach, no built-ins. Tracks the current value x and the previous value p. When these are different, we've switched runs. On switching 0 to 1, prints the current index i. On switching 1 to 0, prints the current index minus one followed by a semicolon.
The if is pretty smelly. Maybe recursion would be better,

Japt, 34 31 25 bytes
Trying a new approach really worked out this time.
V=[]Ur"T+"@Vp[YY-1+Xl]};V

Try it online!
Input is an string with F for false and T for true. Output is an array of arrays; the string representation makes it look like a single array.
How it works
          // Implicit: U = input string
V=[]      // Set V to an empty array. (Why don't I have a variable pre-defined to this? :P)
Ur"T+"    // Take each group of one or more "T"s in the input,
@         // and map each matched string X and its index Y to:
Vp[       //  Push the following to an array in V:
Y         //   Y,
Y-1+Xl    //   Y - 1 + X.length.
]};       //  This pushes the inclusive start and end of the string to V.
V         // Implicit: output last expression

Note: I now see that several people had already come up with this algorithm, but I discovered it independently.
Non-competing version, 22 bytes
;Ur"T+"@Ap[YY-1+Xl]};A

In the latest GitHub commit, I've added a new feature: a leading ; sets the variables A-J,L to different values. A is set to an empty array, thus eliminating the need to create it manually.

Octave, 43 Bytes
@(x)reshape(find(diff([0,x,0])),2,[])-[1;2]

find(diff([0,x,0])) finds all the positions where the input array changes between true and false. By reshaping this into a 2-by-n matrix we achieve two things: The changes from true to false, and from false to true are divided into two rows. This makes it possible to subtract 1 and 2 from each of those rows. Subtracting 1 from row one is necessary because Octave is 1-indexed, not zero-indexed. Subtracting 2 from row two is necessary because the find(diff()) finds the position of the first false value, while we want the last true value. The subtraction part is only possible in Octave, not in MATLAB.
F=0;T=1;
x=[F,F,T,T,F,F,F,F,F,F,F,F,T,T,T,T,T,T,T,T,F,F,F,F,F,F,F,F,F,F,F,F,F,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,T,T]

reshape(find(diff([0,x,0])),2,[])-[1;2]
ans =
    2   12   33   93
    3   19   54   94

x=[T,T,F,F,F,T,T,T,T,T,T,T,T,T,T,F]
reshape(find(diff([0,x,0])),2,[])-[1;2]
ans =
    0    5
    1   14

Nice use of broadcasting!

CJam, 27 25 bytes
0qe`{~~{+}{1$+:X(]pX}?}/;

Expects input like TTFTFT. Try it online.
Explanation
0                               Push 0, to kick off index
qe`                             Push input and run length encode
                                e.g. FFFFTTTFT -> [[4 'F] [3 'T] [1 'F] [1 'T]]
{                 }/            For each pair in the RLE...
 ~                                Unwrap the pair
  ~                               Evaluate T -> 0 (falsy), F -> 15 (truthy)
   { }{         }?                 Ternary based on T/F
    +                                If 'F: add count to index
       1$+:X(]pX                     If 'T: output inclusive range, updating index
;                               Discard the remaining index at the top of the stack

Vyxal, 12 11 bytes
0J0p¯T⁽‹ẇ2ẇ

Try it Online!
Translation of my Jelly answer.
Explanation
0J0p¯T⁽‹ẇ2ẇ
0J             Append 0
  0p          Prepend 0
    ¯         Deltas
     T        Truthy indices
      ⁽ ẇ     Apply to even indices
       ‹        Decrement
         2ẇ   Split into chunks of 2

-1 byte thanks to lyxal

Try it Online! for 11 bytes

@lyxal Thanks! For some reason I didn't find p when searching for "prepend".

Haskell, 74 bytes
import Data.Lists
map(\l->(fst$l!!0,fst$last l)).wordsBy(not.snd).zip[0..]

Usage example: map(\l->(fst$l!!0,fst$last l)).wordsBy(not.snd).zip[0..] $ [True,False,True,True,False] -> [(0,0),(2,3)].
How it works:
                               -- example input: [True,False,True,True,False]

zip[0..]                       -- pair each element of the input with it's index
                               -- -> [(0,True),(1,False),(2,True),(3,True),(4,False)]
wordsBy(not.snd)               -- split at "False" values into a list of lists
                               -- -> [[(0,True)],[(2,True),(3,True)]]
map                            -- for every element of this list
   (\l->(fst$l!!0,fst$last l)) -- take the first element of the first pair and the
                               -- first element of the last pair
                               -- -> [(0,0),(2,3)]

Ruby, 39
->s{s.scan(/T+/){p$`.size..s=~/.#$'$/}}

Sample invocation:
2.2.3 :266 > f=->s{s.scan(/T+/){p$`.size..s=~/.#$'$/}}
 => #<Proc:0x007fe8c5b4a2e8@(irb):266 (lambda)>
2.2.3 :267 > f["TTFTTFTTTFT"]
0..1
3..4
6..8
10..10

The .. is how Ruby represents inclusive ranges.
The one interesting thing here is how I get the index of the end of the range. It's weird. I dynamically create a regular expression that matches the last character of the range, and then all subsequent characters and the end of the string in order to force the correct match. Then I use =~ to get the index of that regex in the original string.
Suspect there might be a shorter way to do this in Ruby using the -naF flags.

J, 26 bytes
[:I.&.|:3(<`[/,]`>/)\0,,&0

This is an unnamed monadic verb (unary function) that returns a 2D array or integers.
It is used as follows.
  f =: [:I.&.|:3(<`[/,]`>/)\0,,&0
  f 1 1 0 0 0 1 1 1 1 1 1 1 1 1 1 0
0  1
5 14

Explanation
[:I.&.|:3(<`[/,]`>/)\0,,&0
                       ,&0  Append 0 to input
                     0,     then prepend 0.
        3(         )\       For each 3-element sublist (a b c):
               ]`>/           Compute b>c
          <`[/                Compute a<b
              ,               Concatenate them
                            Now we have a 2D array with 1's on left (right) column
                            indicating starts (ends) or 1-runs.
[:I.&.|:                    Transpose, get indices of 1's on each row, transpose back.

Jelly, 12 11 10 bytes
;0ŻIT’Ðes2

Try it online!
Accepts a list of zeros and ones. Outputs a list of 1-based ranges.
Explanation
Using [1,1,0,1] as an example.
;0ŻIT’Ðes2   Main monadic link
;0           Append a zero: [1,1,0,1,0]
  Ż          Prepend a zero: [0,1,1,0,1,0]
   I         Increments: [1,0,-1,1,-1]
    T        Indices of truthy alements: [1,3,4,5]
      Ðe     Apply to even indices:
     ’         Decrement: [1,2,4,4]
        s2   Split into groups of two: [[1,2],[4,4]]

Pyth, 19 18 bytes
m-VdU2cx1aV+ZQ+QZ2

Explanation:
             implicit: Q=input
m            map lambda d:
  -V         Vectorized subtraction by [0,1]
     d
     U2
c            split every 2 elements
  x            find all indexes of
    1          1s
    aV         in vectorized xor:
       +ZQ     Q with a 0 on the front
       +QZ     Q with a 0 on the end
  2

Try it here.

JavaScript (ES6), 59
An anonymous function, input as a string of T and F, returning output as an array of arrays
x=>x.replace(/T+/g,(a,i)=>o.push([i,a.length+i-1]),o=[])&&o

TEST

f=x=>x.replace(/T+/g,(a,i)=>o.push([i,a.length+i-1]),o=[])&&o

// TEST

arrayOut=a=>`[${a.map(e=>e.map?arrayOut(e):e).join`,`}]`

console.log=x=>O.textContent+=x+'\n'

;[
  'F','T','TTFT','FTTFFTTT','FTTFFFTTTT','TTFFFTTTTTTTTTTF',
  'FFTTFFFFFFFFTTTTTTTTFFFFFFFFFFFFFTTTTTTTTTTTTTTTTTTTTTTFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFTT'
].forEach(t=>console.log(t+'\n'+arrayOut(f(t))+'\n'))

Wow, I just came up with the same solution in Japt and was about to translate it to JS. Nice one :)

Perl, 47 bytes
s/F*(T*)(T)F*/[$-[0],$+[1]],/g;chop$_;$_="[$_]"

With the following perlrun options -lpe:
$ perl -lpe's/F*(T*)(T)F*/[$-[0],$+[1]],/g;chop$_;$_="[$_]"' <<< 'TTFFFTTTTTTTTTTF'
[[0,1],[5,14]]

Alternative where output is line separated (34 bytes):
$ perl -pE's/F*(T*)(T)F*/$-[0] $+[1]\n/g;chomp' <<< TTFFFTTTTTTTTTTF
0 1
5 15

, 18 chars / 28 bytes
ïħ`T+`,↪ᵖ[_,$Ꝉ+‡_]

Try it here (Firefox only).
Explanation
ïħ`T+`,↪ᵖ[_,$Ꝉ+‡_] // implicit: ï=input
ïħ`T+`,            // for each T-sequence...
       ↪ᵖ[_,$Ꝉ+‡_] // push [start index of sequence, end index of sequence] to the stack
                   // implicit stack output

Haskell, 62 bytes
f l|s<-zip3[0..](0:l)$l++[0]=zip[i|(i,0,1)<-s][i-1|(i,1,0)<-s]

Takes as input a list of 0's and 1's.
Given the list l, pads it with 0 on both sides and computes the indexed list of consecutive pairs. For example
l = [1,1,0]
s = [(0,0,1),(1,1,1),(2,1,0),(3,0,0)]

Then, extract the indices corresponding to consecutive elements (0,1) and (1,0), which are the starts of blocks of 0 and 1, subtracting 1 from the starts of 0 to get the ends of 1, and zips the results.

Wow, that bends syntax more than I thought Haskell would take. Is it equivalent to "f l=let s=zip30..(l++[0]) in zip[i|(i,0,1)<-s][i-1|(i,1,0)<-s]"?

@MichaelKlein Yes, I learned of the trick of binding in guards from nimi here. It's also equivalent to the longer binding-via-lambda f l=(\s->zip[i|(i,0,1)<-s][i-1|(i,1,0)<-s])$zip3[0..](0:l)$l++[0].

APL, 17 chars
{(↑,↑∘⊖)¨⍵⊂⍵×⍳⍴⍵}

In ⎕IO←0 and ⎕ML←3.
In English:

⍵×⍳⍴⍵: zero out the elements of the index vector as long as the argument where the argument is false
⍵⊂: cut at the beginning of each run of truths and throw away the false's
(↑,↑∘⊖)¨: take the first and last element of each subarray

Haskell: 123 bytes (Example, cannot win)
f l=[(s,e)|let m=length l-1,let r=[0..m],s<-r,e<-r,and[l!!x|x<-[s..e]],s<=e,let(#)p=not$l!!p,s==0||(#)(s-1),e==m||(#)(e+1)]

Less golfed:
f l = [(start,end) | start <- [0..max], end <- [0..max], allTrue start end, start <= end, notBelow start, notAbove end]
  where
    max = (length l) - 1
    allTrue s e = and (subList s e)
    subList s e = [l !! i | i <- [s,e]]
    notBelow  s = (s == 0) || (not (l !! (s-1)))
    notAbove  e = (s == m) || (not (l !! (e+1)))

Even when not golfing:  allTrue s e = and (subList s e) or maybe  allTrue = (and.) . sublist.

Ok, for a reason I don't remember, I thought that was more "clear" when I was ungolfing... (Edited)

Oh, sure, opinions differ on what's "clear". I also think all (==True) (subList s e) is very clear.

Python 2, 108 bytes
l=input();l+=[0];o=[];s=k=0
for i,j in enumerate(l):s=j*~k*i or s;~j*l[i-1]and o.append([s,i-1]);k=j
print o

Test cases:
$ python2 rangesinlists2.py
[0]
[]
$ python2 rangesinlists2.py
[-1]
[[0, 0]]
$ python2 rangesinlists2.py
[-1,-1,0,-1]
[[0, 1], [3, 3]]
$ python2 rangesinlists2.py
[0,-1,-1,0,0,-1,-1,-1]
[[1, 2], [5, 7]]
$ python2 rangesinlists2.py
[0,-1,-1,0,0,0,-1,-1,-1,-1]
[[1, 2], [6, 9]]
$ python2 rangesinlists2.py
[-1,-1,0,0,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0]
[[0, 1], [5, 14]]
$ python2 rangesinlists2.py
[0,0,-1,-1,0,0,0,0,0,0,0,0,-1,-1,-1,-1,-1,-1,-1,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,-1]
[[2, 3], [12, 19], [33, 54], [93, 94]]

Surely there's a shorter solution than this, but it works.

CJam, 30 bytes
0l~0++2ewee{1=$2,=},{~0=-}%2/`

Input as a CJam-style array of 0s and 1s. Output as a CJam-style array of pairs.
Run all test cases. (Takes care of the conversion of the input formats.)

Japt, 27 bytes
A=[];Ur"T+"@Ap[YXl +´Y]};A·

There has to be a way to golf this down...
Anyway, it's the same as my  answer.

Wow, I just came up with this solution myself.... Nice algorithm!

Husk, 11 bytes
m§e←→ġo=→ηf

Try it online!
m§e←→ġo=→ηf
         ηf     # get truthy indices
     ġo=→       # group runs of adjacent values
m               # then, for each group
 §e←→           # get the first & last elements

Husk, 14 bytes
§zeW<om←W>`:0Θ

Try it online!

K (oK), 19 bytes
+&:'+{y&~x,z}.'-3':

Try it online!
Uses -n': (window) so the inner {y&!x,z} function has access to the previous (x), current (y), and next (z) value in the input boolean list.

Jelly, 13 bytes
TI’kƊ.ịⱮ$ḢẠ?U

Try it online!
+4 bytes to handle the all 0s test cases. Without that, a much cleaner 9 bytes. This uses 1 indexing, which is Jelly's default.
How it works
TI’kƊ.ịⱮ$ḢẠ?U - Main link
T             - Indices of truthy elements
    Ɗ         - Group the previous links into a monad f(T):
 I            -   Increments
  ’           -   Decrement
   k          -   Partition T at truthy indexes in the decremented increments

                This returns [[]] for [0] (and repeats) and
                [[a, b], [c, d, e], ...] for every other input

           ?  - If:
          Ạ   -   Condition: All truthy?
        $     -   If:
       Ɱ      -     For each partition:
     .ị       -       Take the 0.5th element
         Ḣ    -   Else: Return []

                For non-integer left argument, x, Jelly's ị atom takes
                floor(x) and ceil(x) and returns [floor(x)ịy, ceil(x)ịy]
                As Jelly's indexing is 1-based and modular:
                  0ị returns the last element
                  1ị returns the first element
                  .ị returns [0ị, 1ị]

            U - Reverse, as the ranges yielded by .ị are "reversed"

05AB1E, 12 bytes
Uses 0/1 for F/T.
Åγ.¥ü2sÏ€εN-

Try it online!
Åγ run-length encodes the input, pushing the chunk elements and the chunk lengths.
.¥ takes the cumulative sum of the chunck lengths and prepends a 0.
ü2 creates pairs of all adjacent numbers in this list.
s swaps to the list of chunk elements.
Ï selects each pair which is at the same index as a truthy chunk. The selected pairs are now the half-inclusive truthy range [a, b).
€ε iterates over every number in every range, and N- subtracts the 0-based index from each number to get the inclusive ranges.
Try it with step-by-step output!

Vyxal, 9 bytes
ẏ‡?iŻv₍gG

Try it Online!

PowerShell, 82 bytes
("$args"|sls 't+'-A).Matches|%{if($_){'{0},{1}'-f$_.Index,($_.Index+$_.Length-1)}}

Regex solution, using MatchInfo object's properties.
Example
PS > .\BoolRange.ps1 'F'

PS > .\BoolRange.ps1 'T'
0,0

PS > .\BoolRange.ps1 'TTFFFTTTTTTTTTTF'
0,1
5,14

Mathematica, 45 bytes
SequencePosition[#,{True..},Overlaps->False]&

Not particularly interesting; uses a builtin.

Clojure, 109 chars
#(first(reduce(fn[[r i]p](let[e(+(count p)i)][(if(first p)(conj r[i(dec e)])r)e]))[[]0](partition-by not %)))

The first thing that came to my mind, based on reduce and partition-by.
Simple test case (maps T to true and F to false):
(def f #(first(reduce(fn[[r i]p](let[e(+(count p)i)][(if(first p)(conj r[i(dec e)])r)e]))[[]0](partition-by not %))))
(f (map #(= 'T %) '[F,T,T,F,F,T,T,T]))

Japt, 14 bytes
Takes input as an array of bits.
ð òÈnYÉÃmg[TJ]

Try it

Java (JDK), 181 169 121
a->{int f=-1,p=0;for(int c:a.toCharArray()){if(c<49&f>=0){System.out.println(f+","+~-p);f=-1;}f=c>48&f<0?p:f;p++;}};

Execute:
java T 1100011111111110

Output:
0,1
5,14

Try it online!
Explained
  int f=-1,                               // index of first '1' of current range
      p=0;                                // current position in the input array
  for(int c:a[0].toCharArray()){          // loop over the input from the command line (int & char are exchangeable here
    if(c<49&f>=0){                        // 48='0'; current=0 and we had a '1' range
      System.out.println(f+","+~-p);      // print first and current-1
      f=-1;                               // we are no longer in a 1 range
    }
    f=c>48&f<0?                           // 49='1'; if current='1' and is first of new range,
        p                                 // let f start here
        :f                                // otherwise f unchanged
    p++;                                  // increase current index counter
  }                                       // end of for loop
};                                        // end of function

Edits:
181 -> 169 : interface instead of class; f==-1 -> f<0
169 -> 121 : added suggestions of @ceilingcat and reduced it to a function
121 -> 116 : small, nice improvements, thanks @ceilingcat

Jelly, 8 bytes
Tḟ+¥ⱮØ+Z

A monadic Link that accepts a list and yields a list of start, end pairs of truthy runs (1-indexed, as Jelly is).
Try it online! Or see the test-suite.
How?
Tḟ+¥ⱮØ+Z - Link: list, A
T        - Truthy indices of A -> t
     Ø+  - [1,-1]
    Ɱ    - map (for n in [1,-1]) with:
   ¥     -   last two links as a dyad f(t, n):
  +      -     t add n (vectorises)
 ḟ       -     t filter discard those
       Z - transpose

i.e. get a pair of lists of:

indices of truthy values with no truthy value to their right (run starts); and
indices of truthy values with no truthy value to their left  (run ends)

...and transpose that to a list of [run start, run end] pairs.

Knight, 62 61 bytes
;=i 0;=s T;W;=i+i 1=nP;=nEn&|&s n&!s!n;O Is i-i 1=s!s&!sO-i 1

Try it online!
-1 thanks to Steffan
Uses 1 indexing.
how
;=i 0          # Set i = 0
;=s T          # Set s (for "searching for a 1" to true)
;W;=i+i 1=nP   # While reading a line of input "n" and
               # storing it in n, and incrementing i...
;=nEn          # Coerce "n" to a number, so we can use
               # it as a boolean (string "1" would be false)
&|&s n &!s !n  # If we're "searching" and found a 1 or
               # are not searching and found a 0...
;O Is i-i 1    # output the current index when searching,
               # or the current index - 1 otherwise.
=s!s           # and toggle "searching" status
&!sO-i 1       # if we end on a 1, output again the
               # final index - 1

You can use E (evaluate) instead of +0.


text:
What is the shortest LOOP program that outputs 2016?
LOOP
This challenge is based around a modified version of the programming language LOOP.
A program may be of any of the following forms:

P;Q, where P and Q are subprograms

Subprogram P is executed, then subprogram Q is executed.

x++, where x is a variable

Variable names are the letter x followed by a whole number (0, 1, 2, etc.). The value of variable x is incremented and assigned to variable x.

x:=y, where x and y are variables

The value of variable y is assigned to variable x

LOOP x DO P END, where x is a variable, and P is a subprogram

Subprogram P is executed a number of times equal to the value of x at the start of the loop. If the value of x changes during the loop, the number of iterations does not change.

Spaces and newlines may be inserted anywhere.
For this challenge, you may not use constants.
For example, the code
LOOP x1 DO x2 := x2 + 1; LOOP x2 DO x1++ END END
will set x1 to the x1th triangle number, by adding 1, then 2 etc.
Task
All variables are initialized to 0. The output of the program is the final value of x0, and the length of a program is the total count of increment/decrement/assignment/loop. The goal is to output 2016 with a program that is as short as possible.
Here is an interpreter for the modified language used in this challenge.

The LOOP interpreter you linked to doesn't seem to support the ++ notation.  Do you know of one that does?

@PhiNotPi I'll work on writing one.

I'm not sure what happened to the comment I put here. It was this: "How is this closed with three downvotes and no comments? The challenge should be self-contained and have the LOOP specification, but I think it's very clear what the challenge is--write a LOOP program that sets a variable to 2016 in as few lines as you can."

@KSFT I deleted the comment. The post was previously closed as unclear but was reopened, so the comment saying that it's not unclear was no longer relevant.

@AlexA. It's still relevant to the two people who have still downvoted it.

@KSFT I downvoted it because 1.) it's language-specific, 2.) an interpreter that supports the necessary operations does not yet seem to exist, 3.) I find the task uninteresting. I would imagine that the one other downvoter (as of this writing) felt the same way.

I'm closing this question as off-topic because answers cannot be verified as correct without a working interpreter that supports all necessary operators.

@AlexA. I've attempted to write an interpreter, and I put a link to it in the question. Can we reopen it now?

The interpreter doesn't continue after an END correctly. Also I have a 99 byte answer: x1++;x1++;x1++;x1++;LOOPx1DOLOOPx1DOx2++;x2++;LOOPx1DOx3++ENDENDEND;x3--;LOOPx2DOLOOPx3DOx0++ENDEND.

I think this is not off-topic, but unclear. Nowhere in the description says that <var> := <var> + <var> syntax is allowed, but the example program includes it.

Naive attempt, 15 statements
This uses the factorization of 2016 into 2^5*3^2*7.
x1++;
x1++;
x2:=x1;
x2++;
x3:=x2+x2;
x3++;
LOOP x1 DO
LOOP x1 DO
LOOP x1 DO
LOOP x1 DO
LOOP x1 DO
LOOP x2 DO
LOOP x2 DO
LOOP x3 DO
x0++
END
END
END
END
END
END
END
END

I've gotten this to run on the provided interpreter by replacing things like x1++; with x1:=x1+1;, although I did not use "strict mode."

The linked interpreter doesn't seem to like x3:=x2+x2; otherwise I would suggest using x2:=x3+x1; to save you from having to loop twice over x2.