text:
Write the whole of the holed using the unholed
The ASCII characters from decimal code 33 to 126 are:
!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~

Notice that in most fonts, 25 of these characters have "holes" in them: (a genus greater than 0 you might say)
#$%&04689@ABDOPQRabdegopq

The other 68 "unholed" characters are:
!"'()*+,-./12357:;<=>?CEFGHIJKLMNSTUVWXYZ[\]^_`cfhijklmnrstuvwxyz{|}~

Your task is to write the shortest program possible using only the unholed characters that outputs each of the holed characters exactly once in any order.
Since Space, Tab and newlines (Line Feed and/or Carriage Return) are empty space they may appear in your program or its output. They still count towards the number of characters. Other ASCII characters may not be used (and certainly not non-ASCII characters).
Notes

You do not have to use all of the unholed characters nor only one of each.
The output may not contain unholed characters.
The Whitespace language may be used.
Output should go to stdout or can go to a file. There should be no input.

Bonus: Just for fun, try printing all the unholed characters using the holed characters. I'm skeptical that it can be done in an existing language.

+1 for the title. We do love stuff like this.

68163 characters in jSFuck

Where is the Perl solution?!

Well, no solution in Haskell or C; if it's a program you want, then you need to spell main.

Can we output unholed characters as well?

@C5H8NNaO4 No. Only the holed and the specified whitespace.

Bonus can be done using whitespace.

In Perl and Ruby you can wrap the Bash solution in backticks. Otherwise, I think it's impossible (maybe if you allowed the -p flag, but that seems holey.)

Can you output anything but an error without a p in Python?

How did no one ever notice that I forgot ~??

Pyth, 43 35 characters
tTFk"*+,-7;=?GHIKVWXYhiklnvwx"C-Ck7

Try it here.
Prints the characters in order except that 9 is at the beginning, newline separated.
String contains all characters 7 greater than the ones needed, except that 9 would become @, so it is special cased. Algorithm thanks to @Howard.
Explanation:
tT                print(10-1)                T=10, t(x)=x-1 if x is an int.
Fk"<string>"      for k in "<string>":
C-Ck7             print(chr(ord(k)-7))       Note that C is overloaded as ord and chr.

GolfScript, 37 36 characters
[":=<?)-/! YX[]VIHKx{}|~vih"{25^}/]+

Try the code here.
The string contains the forbidden characters xor'ed with 25. Fortunately all characters are mapped to valid ones.

Brainfuck 119
--[------->++<]>-.+.+.+.++++++++++.++++.++.++.+.+++++++.+.+.++.+++++++++++.+.+.+.[------>+<]>--.+.++.+.++.++++++++.+.+.

uh, the -- at the start... Are you cycling back to 254 on the initial register there?

Yup :) Makes the loop to 36 shorter (in order to get to 35)

Well, it certainly beats my 275... well done...

@Calvin's Hobbies I'm fairly certain no input is allowed, sorry. OP might want to clarify, though.

@isaacg I know, thats why my main code doesnt take input and the last example isn't a serious one :)

No input should be required.

@Calvin'sHobbies Removed the code that required input :)

There are some tricks here: http://esolangs.org/wiki/Brainfuck_constants for shorter constants in BF, including the following 15 character way to make 35: >+[++<[-<]>>+]<. I'm kind of scared of it, actually, nothing should wrap around that many times. Don't feel obligated to use them or anything.

Bonus - dc, 179 characters
Oh good, another restricted character set challenge where P is allowed.
6A44469PD684P44D4898PDB99P4008D0BP486B48BPA60BPD096P4A68666P460A0D4P690490AP8084088P6B6AB66P6BBB608P80D4BAAPA046PBAD4P60A6668P480DD96P4A040BBP848BP40DD8D0P46840B6P696B48BP48D64BAP

Since dc is apparently obscure enough to require explaining (strange to me considering the weird stuff around here!) here's an overview:
It's primarily an RPN calculator with arbitrary-precision arithmetic. But for this challenge, I'm making use of the P command, which interprets a number as a series of characters in base 256 and prints them. Examples: 65 P prints A (ASCII code 65). 16706 P prints AB (16706=65*256+66).
Aside from that, the only other interesting feature is that it recognizes all of the hexadecimal digits 0-9A-F even when they are not contained in a hexadecimal number. Decimal input is the default, so the input token 999 means 9 hundreds + 9 tens + 9 and ABC means 10 hundreds + 11 tens + 12 making it equivalent to 1122.
The ability to use the digits ABD in decimal partially makes up for the inability to use 12357, and the choice of ordering and grouping does the rest. (If I need some numbers x,y,z and they aren't representable with allowed digits, then I try representing x*256*256+y*256+z instead.)
The program can probably be made slightly shorter by using larger groups. I didn't go past 3 bytes per number.

@DigitalTrauma the other way around was the Bonus at the end of the problem statement.

Ha! I missed that! Excellent! +1

Can you explain this? And is there a place we can run this?

A place you can run it? dc isn't some silly language designed for making hard-to-read programs, it's a serious calculator. Run it on any unix machine (or cygwin). http://en.wikipedia.org/wiki/Dc_(computer_program)

@Calvin'sHobbies If you have access to just about any Linux or Unix machine (including OSX), simply save as a text file e.g. bonus.dc, then run dc bonus.dc.  dc is one of the oldest languages out there and has been a permanent fixture in *nix for literally decades.  Its not well-known though, probably due to its arcane and not-very-readable RPN syntax.  Great for some [tag:code-golf] challenges though ;-)

Thanks @DigitalTrauma. Unfortunately I don't have a *nix system handy :/, though I'll try it on cygwin.

@Calvin'sHobbies http://www.cygwin.com/ml/cygwin-announce/2001/msg00188.html

@Calvin'sHobbies: It'd probably be easier to set up a VM than deal with Cygwin (imho). Especially things like Vagrant enable you to have one running in minutes (and most of that is waiting for the download).

@Joey Easily installable on MSYS2 (pacman -S bc). Also, saving the program as a file is unnecessary: echo 'program' | dc.

Bash+coreutils, 56 bytes
tr \(-y \!-r<<<'*+,-7;=?GHIKVWXYhiklnvwx'
tr C-F 7-:<<<E

As luck would have it, adding 7 to the ascii value of the holed characters yields all unholed characters (with the exception of "9").  So we just do this transformation in reverse, then a similar transformation (subtract 12 from "E") to get the "9".
Output:
#$%&0468@ABDOPQRabdegopq
9

I like how the first line subtracts 7 from a bunch of characters, and it contains a -7 conspicuously displayed between punctuation characters, and those 2 facts have nothing to do with each other.

@WumpusQ.Wumbley I hadn't even noticed that :)

Perl -  47 Bytes (thanks @Dom Hastings for the update!)
Perl - 49 Bytes
Edit, 47 bytes:
symlink".",':=<?)-/! YX[]VIHKx{}|~vih'^(F^_)x25

Original, 49 bytes:
symlink".",':=<?)-/! YX[]VIHKx{}|~vih'^chr(25)x25

This is pretty much a Perl version of Howard's solution. XORing the string with 25. The output is a file with the name #$%&04689@ABDOPQRabdegopq. I got the idea to use symlink and the file name as the output format because everything else is banned.
Here's another Perl solution I came up with. It can probably be improved a lot and it is pretty long, so I'm leaving in a readable format for now.
until(y/1/1/>32){s//1/}
until(y/1/1/>125+1){
    if(chr(y/1/1/)!~/[!"'()*+,-.\/12357:;<=>?CEFGHIJKLMNSTUVWXYZ[\\\]^_`cfhijklmnrstuvwxyz{|}~]/) {
        symlink".",chr y/1/1/;
    }
    s/^/1/
}

This one outputs many files, the name of each one is one of the characters. I couldn't figure out how to append strings without using a forbidden character.
for, while, map, say, print, eval, s///e, and any variable name cannot be used (variables start with @ or $ in Perl) which made this difficult.
Hopefully file names are okay as an output format because I'm pretty sure every other way to output information uses one of the banned characters.

I'm going to give you a +1 for creativity! Very clever use of code!

I know this is pretty old, but it's possible to print the output to screen and save a few bytes using the -p flag and *_=\(...): Try it online!

@DomHastings cool! I think the -p flag would be banned though since the p has a hole.

Me again! I know this is even older now (nearly 7 years old!) but you can save a couple of bytes using (F^_) instead of chr(25) :)

@DomHastings thank you!! updated :D

MATLAB, 36 bytes
SO CLOSE.... Only 1 byte more than the current winner (isaacg)! Which, on further inspection, already did what I set out to do too. Well, no harm in reinventing the wheel...
I know this is an old challenge, but I only realized that after I got interested in it.
['*+,-7;=?GHIKVWXYhiklnvwx'-7,57,'']

If only I could get MATLAB to understand that I want a string without a separate ''...
 suggestions, anyone?

Brainfuck 303 275
++++++++[>+>++>+++>++++>+++++>++++++>+++++++>++++++++>+++++++++>++++++++++>+++++++++++>++++++++++++>+++++++++++++>++++++++++++++>+++++++++++++++>++++++++++++++++<<<<<<<<<<<<<<<<-]>>>>+++.--->----.+.+.++>.>----.++.++.+.->.+.+.-->----.++++>-.+.+.+.-->>+.+.-->----.+.++.+>-.+.+.

Brainfuck, the ultimate unholed esoteric language (apart from Whitespace) ;)

Please delete old fragments, don't strike-through.

I see you used the quote thingies (dont know real name) for your code snippets. Might be easier to select your code and press Ctrl+K :)

@isaacg Done. TeunPronk, done!

Or just hit the spacebar 4 times if it's only a line or two. @TeunPronk This? ``` That's a backtick. (Also called a grave accent, although "quote thingies" is a new one for me :P)

@Doorknob Then we both learned something today although what you learned is wrong anyhow :P

JS - 196 - try it
h=(c=!1+[])[1];i=c[2*2];j=(f=[]+{})[1];this[i+'v'+h+'l'](h+'l'+i+'rt('+h+'t'+j+f[2]+'("Iy\x51lJj\\x'+2*2+'1\\x3'+~-1+'Nj\\x'+2*3+'75\x51EFC\x52E\\x3'+3*3+'\x51UVJhYm\x52lZ2\\x3'+3*3+'wc\x51=="))')

Gosh, this is crazy. It seems Js is one of the most abusable language=)

Abusable yes, but this is a mere speck compared to my entry... Sorry @bebe but I've out-JS'd you this time...

@WallyWest i declare war.

217: h=1-1;j=3+3;k='\\x';m=!i+k;c=m[1];f=m[i=2+2];l=k+3;n=k+j;r=k+i;this[f+'v'+c+'l'](c+'l'+f+'rt("\\x23\\x2'+i+k+25+k+2+j+l+h+l+i+l+j+l+2*i+l+3*3+r+h+r+1+r+2+r+i+r+'f\\x5'+h+k+51+k+52+c+n+2+n+i+f+n+7+n+'f\\x7'+h+k+'71")') - inlined l, shortened m, declared i on first use, created a few extra vars for repeated patterns (you could possibly improve this by tweaking the order of chars outputed, but that's beyond my patience :P).

GolfScript, 89 characters
71 22+,{33+}/]''+'!"\'()*+,-./12357:;<=>?CEFGHIJKLMNSTUVWXYZ[\]^_`cfhijklmnrstuvwxyz{|}'-

Simply builds an array of all ASCII characters and subtracts the non-"holed" characters from them.
71 22+,  # Builds array of 0..93
{33+}/]  # Converts to 33..126
''+      # Convert ASCII codes to string
'stuff'- # Subtracts "stuff" (the non-holed characters) from the string

Befunge 98 - 69 bytes
"()+ijWI=*">:5j2 ,-5_"157:h">:5j2 ,-1_"=>?LMN^_lmn">:5j2 ,+3_"?"1+s <

Does it in 3 parts. One where unholed character values differ from holed character by 5. Then the ones that differ by 1, and finally a list of unholed characters that differ by 3 from holed ones. The terminate program instruction in Befunge is "@" (char value 64), so at the end I load "?" (char value 63) add 1 then put that in the code with the instruction 's'.
I could maybe golf it more by consolidating the three
>:5j2 ,(differ value)_

section, but probably not by much.

Main - Insomnia, 50
FFy~~jF~y<={*n<<ztf>={.f=(tHL~k<yf={*n>Lj(FunLn<j~

It outputs:
abdegopq04689@ABDOPQR#$%&

Bonus - Insomnia, 268
ogeeoddp@poe@ggep@oe@opge@gee@%d@p@gqeo@p@ge@e9de49ed9e4dppe@%e@geee@ge@p%ee@%e@dp@%ep@%ee@%d@%eeee@%e@%ee@%e@geee@%e@gee@ggopop@peo@ggep@p@ge@ggeep@ge@gee@%e@geee@ge@gee@ge@ppoep@%ee@%edep@gepe@ge@%ee@%e@geee@ge@%ee@%%eeoe@ge@pep@%gep@p@%e@%%eep@%e@gee@e%e@oe@%gep@p@

It outputs:
!"'()*+,-./12357:;<=>?CEFGHIJKLMNSTUVWXYZ[\]^_`cfhijklmnrstuvwxyz{|}~

I think it should be possible to reduce the length of the program if the output is rearranged, but I need to modify my search program to do this.
Just to show case another language which is capable of operate with a restricted number of characters. By the way, it can write just about any output with only 3 unique characters in the source.
Currently, this is the only language that can do both the main challenge and the bonus among all the existing answers.
Insomnia Interpreter.

Befunge 98 - 46 bytes
Befunge-ified version of isaacg's Pyth entry:
"xwvnlkihYXWVKIHG?=;7-,+*">:5j2 ,-7_"?"1+:,s <

JavaScript 240 228
Initial submission:
z=(!1+"")[1];y=(!!1+"")[3];x={}+"";w=x[1];v=x[2];u=z+"t"+w+v;1[_="c\157nstruct\157r"][_](z+'l'+y+'rt('+u+'("Iy\x51lJj"+'+(t=u+'("\x51\x51==")')+'+'+u+'("M"+'+t+'+"==")+"Nj"+'+u+'("Zw==")+"5\x51EFC\x52E\71\x51UVJhYm\x52lZ2\71wc\x51=="))')()
Now, this is a great start, here's how it breaks down...
z=(!1+"")[1];        // assigns "a" to z, !1+"" === "false"
y=(!!1+"")[3];       // assigns "e" to y, !!1 === "true"
x={}+"";             // assigns "[object Object]" to x
w=x[1];v=x[2]        // assigns "o" to w, and "b" to v
u=z+"t"+w+v;         // creates the mystical "atob" command, yes, I'm gonna use it!
1[_="c\157nstruct\157r"][_] // sets up the primitive to a number object... this acts similar to the "window" primitive object so that I can play off functions...
z+'l'+y+'rt(         // starts creating an alert call
'+u+'("Iy\x51lJj"+'+(t=u+'("\x51\x51==")')+'+'+u+'("M"+'+t+'+"==")+"Nj"+'+u+'("Zw==")+"5\x51EFC\x52E\71\x51UVJhYm\x52lZ2\71wc\x51=="))')()
// Above line abuses atob command with a couple of nested instances of the command, also using hex and octal equivalents of characters

And then I thought... "There must be a simpler way..." and there is...
Revised submission:
z=(!1+"")[1];y=(!!1+"")[3];x={}+"";w=x[1];v=x[2];u=z+"t"+w+v;this[y+"v"+z+"l"](z+'l'+y+'rt('+u+'("Iy\x51lJj"+'+(t=u+'("\x51\x51==")')+'+'+u+'("M"+'+t+'+"==")+"Nj"+'+u+'("Zw==")+"5\x51EFC\x52E\71\x51UVJhYm\x52lZ2\71wc\x51=="))')
Seeing I can use eval  (by piecing it together, inspiration from @bebe; which is a lot quicker than using the constructor of a constructor of a number... ) I drilled it down to 228... I know it may not win this particular Golf Challenge, but this is just my way of showing how much you can abuse JavaScript, and still get the desired result...

Japt, 33 bytes
7+2+"*+,-7;=?GHIKVWXYhiklnvwx"c-7

Try it online!
Same algorithm as isaacg's Pyth submission, just happens to be shorter in Japt.
How it works
7+2+"*+,-7;=?GHIKVWXYhiklnvwx"c-7

7+2           Obviously the number 9
    "..."c-7  Apply -7 on each char's charcode of this string
   +          String concatenation

Yes, it's JS, which is one of the most abusable languages, just shorter (and you don't need alert or console.log here).

Vyxal s, 33 bytes
`*+,-7;=?GHIKVWXYhiklnvwx`C7-57JC

Try it Online!
Uses the same (independently discovered) trick of subtracting 7 and putting a  9 on the end.

PHP, 59 bytes
<?='MMMMMMMMMM:::::::::::::::'^"nihk}y{ut\r{x~ujkh[X^_]UJK";

Try it online!
Explanation
Utilises the string-XOR operator (^) to build the desired string from non-holed letters, output via <?=.
Verification for 59 bytes.

Perl 5, 72 bytes
*_=*~;("*,*E'syswrit\LE"^icx)->(uc,':=<?)-/! YX[]VIHKx{}|~vih'^(F^_)x25)

Try it online!
Explanation
I know this is longer than the existing Perl answer, but this outputs using STDOUT, rather than a filename.
*_=*~ aliases the ~ variables (@, %, and $) into _, meaning that $* (which is STDOUT by default) is now in $_, which we can access using uc (which returns $_ by default if no arguments are passed). Next the string CORE::syswrite is built from a combination of the stringwise-XOR of the two strings and the in-line lowercase modifier (\L) of E, which is then called as a function ->(...) with the arguments STDOUT (from uc) and the desired string, also built via stringwise-XOR (copied from @hmatt1's answer and amended to to save bytes using more stringwise-XOR).

PICO-8, 196 bytes
c=77+2?"\35\37\52\57\111\112\113\71"..chr(33+3)..chr(31+7)..chr(32*2)..chr(72-7)..chr(71-5)..chr(71-3)..chr(71-2)..chr(c)..chr(c+1)..chr(c+2)..chr(75+22)..chr(75+23)..chr(c+21)..chr(57*2)..2*13*31

More variables like c might reduce size, not in the mood to try more at the moment.


text:
Solve the (Rubiks) Pocket Cube
Your task
.. is to do what Brian Fantana apparently couldn't do, and solve the 2x2x2 Rubik's Cube.

The Layout
- -   A B   - -   - -
- -   C D   - -   - -

E F   G H   I J   K L
M N   O P   Q R   S T

- -   U V   - -   - -
- -   W X   - -   - -

And will be given to you via stdin or the command line (your choice - please specify in your answer) in the format:
ABCDEFGHIJKLMNOPQRSTUVWX

Note that A-D make up the U-face(up), EFMN make up the L-face(left), GHOP make up the F-face(front),  IJQR make up the R-face(right), KLST make up the B-face(back), and U-X make up the D-face(down).
There will be six unique characters representing each color, but they may vary, so prepare for any combination of 6 ascii characters to be used for each color.
Specifications

Your code should output a solution using only the Right (R), Upper (U), and Front(F) faces, and should use the standard notation: R , R' , R2 , U , U' , U2 , F , F' , F2. You can find more info here. The restriction to the RUF subset is standard for the 2x2 cube (Hint: treat the bottom-back-left corner as a fixed base to work from).
Your code must be capable of solving all possible permutations of the pocket cube.
Each solution should take less than 30 seconds to complete.
Each solution should be less than 30 moves.
A bonus of -20% will be given for solutions always providing answers less than 20 moves (please advertise it in your answer so I can do a thorough check for it)
A bonus of -50% will be given for code which always provides an optimal solution. - Again, please advertise in your answer
Solutions must not contain two consecutive moves on the same face, because they can be easily combined into one move.
Solutions can optionally contain a single space - and only a single space - between each move.
The whole solution sequence, if necessary, may be contained in a pair of parentheses, quotation marks, braces, brackets, or carets, but no other extraneous output is allowed.
Please provide either a briefly commented version of your code or a thorough explanation of your code.
No use of external files. This includes internet, data tables, and libraries/packages made for this sort of problem.
Shortest code by byte count wins.
Winner chosen Wednesday (July 30, 2014).

We have 2x2, and 3x3, and 4x4, but I'm still waiting for the 1x1 challenge for my chance to shine. I have a perfect algorithm!

Here's a ~500 character solver in K, which generates even the optimal (=shortest) solution: http://www.speedsolving.com/forum/showthread.php?25460-My-python-one-liner-scramble-generator&p=760151&viewfull=1#post760151

30 seconds should be enough to brute force it using Dijkstra: there are only 3674160 positions.

I assume there are no restrictions on whitespace in the output 2. In order to be objective, you should define the bonus for solutions less than 20 moves instead of leaving it as "discretionary."

@steveverrill Fixed it. Also added the whitespace specification. Thanks!

Python 2.7: 544 bytes -50% = 272 bytes**
import sys;o=''.join;r=range;a=sys.argv[1];a=o([(' ',x)[x in a[12]+a[19]+a[22]] for x in a]);v={a:''};w={' '*4+(a[12]*2+' '*4+a[19]*2)*2+a[22]*4:''}
m=lambda a,k:o([a[([0x55a5498531bb9ac58d10a98a4788e0,0xbdab49ca307b9ac2916a4a0e608c02,0xbd9109ca233beac5a92233a842b420][k]>>5*i)%32] for i in r(24)])
def z(d,h):
 t={}
 for s in d[0]:
  if s in d[1]:print d[h][s]+d[1-h][s];exit()
  n=[d[0][s],'']
  for k in r(3):
   for j in r(3):s=m(s,k);t[s]=n[h]+'RUF'[k]+" 2'"[(j,2-j)[h]]+n[1-h]
   s=m(s,k)
 d[0]=t;return d
while 1:v,w=z([v,w],0);w,v=z([w,v],1)

Stackexchange replaces tabs with multiple whitespaces. So technical this version has 549 bytes. Just replace the first two spaces in the lines 6-10 with a tabulator.
Idea behind my program:
My first idea was a breath first search. But this took too long. Around 2 minutes for a hard (11 move optimal) scramble.
So I decided to approach the problem from both sides. I use two sets. I generate    sequentially all states with distance 1,2,3,... to the scramble and save them in set1, and at the same time all states with distance 1,2,3,... to the solved state and save them in set2.
The first time a state is in both sets, we found the solution.
For this I need the colors of the solved cube, which are not known. The characters 13, 20 and 23 define the left, back and down color. But these 3 colors are sufficient to represent the cube. I simply replace the other 3 colors with whitespaces and I can represent my solved state as '____ll____bbll____dddd'.
Oh, and for shortening the permutations I used an idea from https://codegolf.stackexchange.com/a/34651/29577
Ungolfed version:
import sys

#define permutations for R,U,F
permutation = [[0,7,2,15,4,5,6,21,16,8,3,11,12,13,14,23,17,9,1,19,20,18,22,10],
            [2,0,3,1,6,7,8,9,10,11,4,5,12,13,14,15,16,17,18,19,20,21,22,23],
            [0,1,13,5,4,20,14,6,2,9,10,11,12,21,15,7,3,17,18,19,16,8,22,23]]

def applyMove(state, move):
    return ''.join([state[i] for i in permutation[move]])

scramble = sys.argv[1]
#remove up,front,rigth colors
scramble = ''.join([(' ', x)[x in scramble[12]+scramble[19]+scramble[22]] for x in scramble])
solved = ' '*4+scramble[12]*2+' '*4+scramble[19]*2+scramble[12]*2+' '*4+scramble[19]*2+scramble[22]*4

dict1 = {scramble: ''} #stores states with dist 0,1,2,... from the scramble
dict2 = {solved: ''} #stores states with dist 0,1,2,... from the solved state

moveName = 'RUF'
turnName = " 2'"

for i in range(6):
    tmp = {}
    for state in dict1:
        if state in dict2:
            #solution found
            print dict1[state] + dict2[state]
            exit()
        moveString = dict1[state]
        #do all 9 moves
        for move in range(3):
            for turn in range(3):
                state = applyMove(state, move)
                tmp[state] = moveString + moveName[move] + turnName[turn]
            state = applyMove(state, move)
    dict1 = tmp
    tmp = {}
    for state in dict2:
        if state in dict1:
            #solution found
            print dict1[state] + dict2[state]
            exit()
        moveString = dict2[state]
        #do all 9 moves
        for move in range(3):
            for turn in range(3):
                state = applyMove(state, move)
                tmp[state] = moveName[move] + turnName[2 - turn] + moveString
            state = applyMove(state, move)
    dict2 = tmp

I'm pretty happy with the result, because I'm quite new to Python. This is one of my first python programs.
edit: half a year later: 427 - 50% = 213.5
Got a little bit more experience in Python and in golfing. So I revised my original code and could save more than 100 character.
import sys;o=''.join;a=sys.argv[1];d=[{o((' ',x)[x in a[12]+a[19]+a[22]]for x in a):[]},{' '*4+(a[12]*2+' '*4+a[19]*2)*2+a[22]*4:[]}]
for h in[0,1]*6:
 for s,x in d[h].items():
  for y in range(12):
   d[h][s]=x+[y-[1,-1,1,3][h*y%4]];
   if s in d[1-h]:print o('RUF'[x/4]+" 2'"[x%4]for x in d[0][s]+d[1][s][::-1]);exit()
   s=o(s[ord(c)-97]for c in'acahabcdnpbfegefhugiovjgqkciljdeklflmmmnnvoopxphrqdjrrbsstttuuqsviwwwkxx'[y/4::3])

I basically use the exact same approach. The biggest change is, that I don't define a function anymore. Instead of
def z(d,h):
 for s in d[0]:
  if s in d[1]:...
while 1:v,w=z([v,w],0);w,v=z([w,v],1)

I can do
for h in[0,1]*6:
 for s in d[h]:
  if s in d[1-h]:...

Also I changed the move lamda a little bit. First shortend, and then integrated the code directly, since the function call only appears once.
I keep for each state a list of numbers between 0 and 11, to represent the moves, instead of a string containing the moves. The numbers are converted at the very end.
Also I combined the two for-loops 'for k in r(3):for j in r(3): into one for y in r(12). Therefore I also have to do the moves U4, R4, F4. Of course such a move doesn't appear in the shortest solution, so " 2'"[x%4] works. (If x % 4 == 3, there would be a index out of range exception)
It's also a little bit faster, since I look for the entry in the second set earlier. About 0.5 second for a 11 move solution.

Upvoted for using bidirectional bfs - my favorite search algorithm (next to IDA*). If time allows, I will test it in a few hours for optimality. Also, I didn't realize that you don't really need the U/R/F colors to solve the puzzle. Nicely done!

Passed for my 20 test cases for correctness & optimality.

very nice.. helped me for implementing a faster than 24! single directional bfs in js

actually '____ll____bbll____dddd' should be '____ll____bbll____bbdddd'

C, 366 - 50% optimal bonus = 183
char c[99],t[3][26]={"ZGONFZCPTEZBHUMZ","ZIQPHZRUGAZJWOCZ","ZACB@ZJHFDZKIGEZ"};r=20;f(int m,int n){int e,i,j;for(i=4;i--;){for(j=15;j--;)c[t[n][j+1]]=c[t[n][j]];c[m]="FRU"[n],c[m+1]="4'2 "[i],c[m+2]=0;for(e=0,j=68;j<76;j++) e+= (c[j]!=c[j+8]) + (c[j]!=c[j^1]);i&&e&&e<45-m*2&m<r?f(m+2,(n+1)%3),f(m+2,(n+2)%3):e||(puts(c),r=m);}}main(){scanf("%s",c+64);f(0,2),f(0,1),f(0,0);}

Using recursion, the program searches through a tree of up to 11 moves deep (the max length of an optimal soluton according to http://en.wikipedia.org/wiki/Pocket_Cube and the page mentioned below) and when it finds a solution it prints it (up to 22 characters long, tracked by function argument m.) The order used is a kind of dictionary order, where all routes begining U,U2,U' are searched before any routes beginning R or F are searched. Thus it does not necessarily find the optimal solution first.
When a solution is printed, r is made equal to m which ensures that only equal or shorter solutions will be printed afterwards. Putting r=m-2 costs an extra 2 characters but ensures only one solution of each length found (down to optimal) is printed. If you want it to ONLY show the optimal solution, the best solution found so far must be stored to a variable, and the optimal solution printed at the end of the program (this would cost about an extra 15 characters.)
the input is read into the array c[] from index 64 onwards. This is necessary in order to use alphabet characters in the movetable. The symbols @ through W are used instead of A through X per the question, because it is necessary to start on an even number to make the test for solutions work. c['Z'] is also used for temporary storage, because in order to perform 4-fold rotation a total of 5 assignments are needed. Because the first part of c[] is unused, it is available to store the solution (which is terminated with a zero byte, like all C strings.)
for(i..) goes through a sequence of 4 quarterturns of the face specified by n.
The first for(j..) performs the actual swapping according to table t[].
To test if the cube is solved, it is only necessary to check the four side faces. The pieces URF and DFR can be distinguised even with the U and D stickers removed, because one piece reads XRF in the clockwise direction and the other XFR. If the two pieces are interchanged so that U shows on the down face and vice versa, the F colour will show on the right face and vice versa.
The second for(j..) counts the number of mismatches on the four side faces. For example for the front face it compares G & O, H & P, and G & H (twice.) If e==0, the cube is solved. If e<9 or e<13, it might be possible to solve the cube in the next one move or 2 moves respectively. Otherwise it definitely not possible to solve the cube in this number of moves. In order to save time, this heuristic is used to prune the search tree and avoid wasting time on many of those branches of depth 10 or 11 which will be unsuccesful. Expressed as a formula, this becomes e<45-m*2.
Ungolfed Code
char c[99],t[3][26]={"ZGONFZCPTEZBHUMZ","ZIQPHZRUGAZJWOCZ","ZACB@ZJHFDZKIGEZ"};
r=20;                                                       //All moves are output as 2 characters. The index of the last move of the longest solution (11 moves) shall be 20.

f(int m,int n){                                             //perform a cycle through four 1/4 turns of the face specified in n. The index of the move reported in the solution is m.
  int e,i,j;                                                //e is for counting mismatches. i loops through the four 1/4 turns. j performs other functions.
  for(i=4;i--;){

    for(j=15;j--;)c[t[n][j+1]]=c[t[n][j]];                  //A 1/4 turn is performed as three 4-sticker rotations of the type z=a;a=b;b=c;c=d;d=z using the data in the movetable t[][]

    c[m]="FRU"[n],c[m+1]="4'2 "[i],c[m+2]=0;                //Write to the output in c[] the face to be turned and the number of 1/4 turns. Terminate with a zero byte to overwrite any longer solution that may have been found before.

    for(e=0,j=68;j<76;j++)e+=(c[j]!=c[j+8])+(c[j]!=c[j^1]); //Compare each sticker of the top row of the side faces (64+4 through 64+11) with the stickers below and beside it. Count the number of mismatches.

    i && e && e<45-m*2 & m<r?                               //if the number of 1/4turns is not 4 AND the cube is not solved AND the heuristic (as described in the text) is good AND a shorter solution has not already been found,
      f(m+2,(n+1)%3), f(m+2,(n+2)%3):                       //deepen the search to another faceturn of the other two faces.
      e||(puts(c),r=m);                                     //otherwise, if a solution has been found, print the solution and reduce the value of r to the new max solution length.
  }
}

main(){
  scanf("%s",c+64);                                         //scan in the current cube state to c[] at index 64.
  f(0,2),f(0,1),f(0,0);                                     //call f() three times to search for solutions beginning with U R and F.
}

Performance
The program was tested with patterns 1 to 13 at http://www.jaapsch.net/puzzles/cube2.htm
Results as follows give the timing on my machine to find ALL optimal solutions (for the curious-minded.) Also for the more complex positions, the timing is given for the 2-byte modification mentioned above which finds just one optimal solution. For this timings are given both to find the first solution and for the program to terminate. The solutions given (which are generally different to the solutions obtained by reversing the generators on the linked page) have been verified with an online cube simulator.
U 4 (1 move) horizontal flags (not mirror symmetric)
1 solution 1 sec

U2 (1 move) 4 horizontal flags (mirror symmetric)
1 solution 1 sec

F2 R2 F2 (3 moves) 4 vertical flags
UUUULRBFRLFBLRBFRLFBDDDD 2 solutions 1 sec

U2 F2 R2 U2 (4 moves) Supertwist; 6 flags
DDUURRBFRRFBLLBFLLFBUUDD 3 solutions 1 sec

U F2 U2 R2 U (5 moves) 4 vertical flags, 2 checkerboards
UDDULBRFRFLBLBRFRFLBUDDU 2 solutions 1 sec

R2 F2 R2 U2 (4 moves) 4 checkerboards
UUUURLFBLRBFLRBFRLFBDDDD 4 solutions 1 sec

R U2 R' F2 R U' R2 U F2 U' (10 moves) Cube in cube
FFFUDDRFRULLLDRRUULBBBDB 18 solutions 26 sec; 1 solution U F2U'R2U R'F2R U2R' 1,13 sec

R F U' R2 U F' R U F2 R2 (10 moves) Cube in cube 2
DDDUFFLFRBRRLFLLBBRBUUDU 8 solutions 28 sec; 1 solution R F U'R2U F'R U F2R2 12,21 sec

U R F2 U R F2 R U F' R (10 moves)3-Cycle
UFFULDRFRULBLLFRURBBDBDD 45 solutions 26 sec; 1 solution U R'F U'F'R'F2U R F2 8,14 sec

U R U' R2 U' R' F' U F2 R F' (11 moves) Column turn
UUUDLLFRFRBBLLFRFRBBDUDD many solutions 29 sec; 1 solution U R U'F U2R F'R'F'U2F' 3,27 sec

F' U R' F2 U' R F U R2 U R' (11 moves)Corner swap
UUUURLFBLRBFLLFFRRBBDDDD 29 sec 24 solutions; 1 solution R U'F R U'R2U'F'R'U F2 12,28 sec

U F2 U' (3 moves) Zig-zag
UDUDLLFRFFLBLBRRFRBBUUDD 1 solution 1 sec

U' F2 U2 R2 U' F2 U2 R2 U' (9 moves) 2 Checkerboards, 4 L
DUUDLLFBRRBFLRFFRLBBUDDU 8 solutions 13 sec; 1 solution U F2U2R2U R2U2F2U' 1,5 sec

Sounds good. I'd love to see a close competition here.

@KyleMcCormick My program is finally finished and running well but I see you got tired of waiting and accepted the other answer. It's much better than my post the 2 days ago which had a bug (faces turning the wrong way.) Also, applying the heuristic to 2 levels has improved the speed. It still outputs several solutions, but the last solution is guaranteed to be optimal (more on possible output changes in the text.) It's a lot shorter than the other submission. If you have any issues on the output format let me know.

358 bytes via basic golfs.

source: Stack Exchange

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

authors: Артур Хабибуллин

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

sort: votes