text:
What is the minimum set of characters with which you can write any valid python program?
The proof of the set of characters is that there is a translator which takes any ascii python program as input and produces a limited character set version of the program. The limited character set program can be slower than the original program. It simply has to be possible to produce the same output as the valid python program.
For example, here is a translator that takes any ascii python program as input and writes out a version that doesn't use the character x:
import random
import string
with open('in.py') as infile:
    with open('out.py', 'w') as outfile:
        lines = infile.readlines()
        outfile.write("data = '")
        random_string = ''.join(random.choice(string.digits) for x in range(20))
        for line in lines:
            outfile.write(line.encode('string-escape').replace('x', random_string))
        outfile.write("'\n")
        outfile.write("exec data.replace('%s', chr(%s))" % (random_string, ord('x')))

note that this will fail if the program happens to have the random string in it already, but for the purposes of this question lets accept that 'any' can be slightly limited. We don't have to consider extremely low probabilities of failure due to random chance or a malicious input program.

The question is? No idea about the sense of this "questions"

good luck writing a useful program without sorted(set('import for while = in : if def [] return class () break .')) On the other hand, you can write http://en.wikipedia.org/wiki/Whitespace_(programming_language) programs with only three characters.

@msw: To be fair, that's not true. All for loops can be replaced with while loops (though admittedly that doesn't get you anywhere if you leave in def, import, and return), all list literals could turn from [...] to list((...)), you can shuffle a program to avoid any break, and there are probably similar transformations.

@vishvanda: While this question has problems, it did inspire me to write such a translator, which removes all characters except for "()+,.1[]cehijnorx. My solution is here.

@msw: As you can see in my gist, it's actually possible to write any Python program with just the characters "()+,.1[]cehijnorx).

Interesting, amusing, and likely a fun puzzle. Cheers.

I thought it was pretty interesting, too bad it was closed as.

By the way, I've improved my solution to use only 9 characters: ()+1cehrx.

But does it support unicode ;) Good explanation regarding codegolf, too.

I've come up with a 9-character translator using exec (also posted at this GitHub gist):
def convert_txt(txt):
    """Convert the text of a Python program to minimal Python"""
    s = "+".join(["chr(%s)" % "+".join(["1"] * ord(c))
                            for c in txt])
    return 'exec(%s)' % s

The only characters it needs are ()+1cehrx.

LOOOOOOOOOOOOOL +1

Does Python permit literal chr(0) characters in strings?

That's not how it's used here. This creates a program whose string is like exec(chr(1+1+1...)+chr(1+1...)). The new program thus uses only 9 characters, reconstructs the string, and uses exec

Precisely. So if I pass it a Python program which contains a literal chr(0) it will break. The most obvious place in which a literal chr(0) would be valid is inside a string.

Sorry, I misunderstood your original question. Anyway, I've been able to use it: for example, chr(100) + chr(0)+chr(65) yields 'd\x00A'. Am I missing something?

Oh! I misunderstood you yet again. Yes, it would lead to an error, as would a Unicode character.

You can support unicode and null characters if desired without extra characters by doing two translation steps:
the first to exec(unichr(0+1+1+1+...)+...) to remove all unicode and null characters and the second as above to remove 'uni0'

@paradigmsort Nice! Of course, that would cause the length of the code to expand by another ~2 orders of magnitude. Now that would just make it impractical...

This has been beaten! 8 chars

Now in 7 chars


text:
Code-Golf: Count Islands
A simple contest, inspired by this stackoverflow question:

You are given an image of a surface photographed by a satellite.The image is a bitmap where water is marked by '.' and land is marked by '*'. Groups of adjacent '*'s form an island. (Two '*' are adjacent if they are horizontal, vertical or diagonal neighbours). Your task is to print the number of islands in the bitmap.

A single * also counts as an island.
Sample Input:
.........**
**......***
...........
...*.......
*........*.
*.........*

Sample Output:
5

Winner is entry with smallest number of bytes in the code.

I don't understand the logic. Aren't 5 stars in the top right corner considered as one island? Then your example has 4 islands.

the screen doesn't wrap. one island in each of the corners + the lone * island

But by your definition, an island is a group of '*' characters, implying more than one.

oh fair point. stand-alone *s are also islands.

Mathematica 188 185 170 115 130 46 48 chars
Explanation
In earlier versions, I made a graph of positions having a chessboard distance of 1 from each other.  GraphComponents then revealed the number of islands, one per component.
The present version uses MorphologicalComponents to find and number clusters of ones in the array--regions where 1's are physically contiguous. Because graphing is unnecessary, this results in a huge economy of code.

Code
Max@MorphologicalComponents[#/.{"."->0,"*"->1}]&

Example
Max@MorphologicalComponents[#/.{"."->0,"*"->1}]&[{{".", ".", ".", ".", ".", ".", ".", ".", ".", "*", "*"}, {"*", "*", ".", ".", ".", ".", ".", ".", "*", "*", "*"}, {".", ".", ".", ".", ".", ".", ".", ".", ".", ".", "."}, {".", ".", ".", "*", ".", ".", ".", ".", ".", ".", "."}, {"*", ".", ".", ".", ".", ".", ".", ".", ".", "*", "."}, {"*", ".", ".", ".", ".", ".", ".", ".", ".", ".", "*"}}]

5

How it works
Data are input as an array; in Mathematica, this is a list of lists.
In the input array, data are converted to 1's and 0's by the replacement
/.{"."->0,"*"->1}

where /. is an infix form of ReplaceAll followed by replacement rules. This essentially converts the array into a black and white image.  All we need to do is apply the function, Image.
Image[{{".", ".", ".", ".", ".", ".", ".", ".", ".", "*", "*"}, {"*", "*", ".", ".", ".", ".", ".", ".", "*", "*", "*"}, {".", ".", ".", ".", ".", ".", ".", ".", ".", ".", "."}, {".", ".", ".", "*", ".", ".", ".", ".", ".", ".", "."}, {"*", ".", ".", ".", ".", ".", ".", ".", ".", "*", "."}, {"*", ".", ".", ".", ".", ".", ".", ".", ".", ".", "*"}} /. {"." -> 0, "*" -> 1}]

The white squares correspond to the cells having the value, 1.
The picture below shows a some steps the approach uses. The input matrix contains only 1's and 0's.   The output matrix labels each morphological cluster with a number.  (I wrapped both the input and output matrices in MatrixForm to highlight their two dimensional structure.)
MorphologicalComponents replaces 1s with an integer corresponding to the cluster number of each cell.

Max returns the largest cluster number.

Displaying the Islands
Colorize will color each island uniquely.

This isn't working as written on v7 because MorphologicalComponents wants an Image, but even on v9 shouldn't this be Max@MorphologicalComponents[d/.{"."->0,"*"->1}]?  That is, the replacement done first?  Max would disappear before the replacement was done, would it not?

I have V9, @Mr.Wizard is right. 46 characters is the right number.

@Mr.Wizard  The replacement is carried out before the application of MorphologicalComponents.  Must be a precedence thing.

Hi @DavidCarraher, my point is not about "->" but that the expression Max@MorphologicalComponents@d/.{"."->0,"*"->1} do not work, what make sense is Max@MorphologicalComponents[d /. {"." -> 0, "*" -> 1}], so you have one more character.

Ruby 1.9 (134 121 113 110)
Takes the map on stdin or the file name of the map as the first command-line argument, and prints the number of islands to stdout.  Using a basic recursive flood-fill.  Improvements welcome as always!
c=0
gets$!
c+=1while(f=->i{9.times{|o|$_[i]=?.;f[o]if$_[o=i+(o/3-1)*(~/$/+1)+o%3-1]==?*&&o>0}if i})[~/\*/]
p c

Similar to David's colorize, you can also get it to display the different islands by changing $_[i]=?. to $_[i]=c.to_s and p c to puts$_, which would give you something like this:
.........00
11......000
...........
...2.......
3........4.
3.........4

(at least until you run out of digits!)
Some test cases:
.........**
**......***
...........
...*.......
*........*.
*.........*

5
......*..**....*
**...*..***....*
....*..........*
...*.*.........*
*........***....
*.....*...***...
*.....*...*....*
****..........**
*.........*.....

9
*

1
****
****
....
****

2
**********
*........*
*.******.*
*.*....*.*
*.*.**.*.*
*.*.**.*.*
*.*....*.*
*.******.*
*........*
**********

3

I like the last test. Thinking inside the box!

C, 169 chars
Reads map from stdin. Had no luck improving the recursive flood-fill function r(j) although it looks like it could be.
c,g,x,w;char m[9999];r(j){if(m[j]==42)m[j]=c,r(j+1),r(j+w-1),r(j+w),r(j+w+1),c+=j==g;}main(){while((m[x++]=g=getchar())+1)w=g<11*!w?x:w;for(;g++<x;)r(g);printf("%i",c);}

Python 2, 223 203 Bytes
Thank you to Step Hen and Arnold Palmer for shaving off 20 characters of spaces and unnecessary parenthesis!
s=input()
c=[(s.index(l),i)for l in s for i,v in enumerate(l)if'*'==v]
n=[set([d for d in c if-2<d[0]-v[0]<2and-2<d[1]-v[1]<2])for v in c]
f=lambda x,p=0:p if x&n[p]else f(x,p+1)
print len(set(map(f,n)))

I thought that using list comprehensions might decrease the number of bytes, but it didn't provide any significant improvement.
Try it here.
I keep trying to trim it around the n (neighbors) list, but I haven't been successful. Maybe someone else will have some ideas for that section.

Welcome to PPCG! Here's 217 bytes by removing some spaces. The Python parser is really lenient :P

You have more whitespace than needed. Remove the spaces between (s.index(l),i) and for, enumerate(l) and if, -v[0])<2 and and, p=0: and p, and bool(x&n[p]) and else. You also have more parenthesis than needed in your print statement, since you have 2 groups surrounding set. Edit: Beat by StepHen cause doing stuff on mobile isn't ideal.

203 bytes combining @StepHen's and my suggestions, plus changing the conditionals a bit.

Thank you both for the help! Python's leniency keeps surprising me : )

Perl 5, 100 bytes
98 bytes of code + 2 bytes for -p0 flags.
/.*/;$@="@+"-1;$~="(.?.?.{$@})?";(s/X$~\*/X$1X/s||s/\*$~X/X$1X/s)&&redo;s/\*/X/&&++$\&&redo}{$\|=0

Try it online!
An adaptation (or rather a simplification) of my answer to the challenge How Many Holes?. You can find explanations of how this code works on this other answer (it's a bit long to explain, so I prefer not to retype the entire explanations).

Python 2, 233 bytes
Too long, compared to other answers. Port of my answer to this question.
Try it online
A=input()
c=0
X=len(A[0])-1
Y=len(A)-1
def C(T):
 x,y=T
 if A[y][x]<'.':A[y][x]='.';map(C,zip([x]*3+[min(x+1,X)]*3+[max(x-1,0)]*3,[y,min(y+1,Y),max(y-1,0)]*3))
while'*'in sum(A,[]):i=sum(A,[]).index('*');c+=1;C((i%-~X,i/-~X))
print c

JavaScript, 158 bytes
function f(s){w=s.search('\n');t=s.replace(RegExp('([*@])([^]{'+w+','+(w+2)+'})?(?!\\1)[*@]'),'@$2@');return t!=s?f(t):/\*/.test(s)?f(s.replace('*','@'))+1:0}

Noncompeting ES6 answer (language postdates challenge) for 132 bytes:
f=s=>s!=(s=s.replace(RegExp(`([*@])([^]{${w=s.search`
`},${w+2}})?(?!\\1)[*@]`),`@$2@`))?f(s):/\*/.test(s)?f(s.replace(`*`,`@`))+1:0

Port of my answer to How Many Holes? (yes I'm jumping on the bandwagon, now that I've seen two other people port their answers).

Python 2, 225 bytes
g=map(list,input())
q,w,t,r=len(g),len(g[0]),0,range
def l(i,j):
 if 0<=i<q and 0<=j<w and g[i][j]=='1':g[i][j]=0;l(i+1,j);l(i-1,j);l(i,j+1);l(i,j-1)
 return 1
print sum(l(i,j)if g[i][j]=='1'else 0 for j in r(w)for i in r(q))

Try it online!

-1 bytes, suggested by an anonymous user

source: Stack Exchange

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

sort: votes


text:
Draw a tiled cube of any size
Draw a tiled cube of any size, in ASCII art.
You will be given three numbers a, b and c, and the program should output an a*b*c sized cube.
Examples
3 3 3 ->
    ____ ____ ____
  /____/____/____/|
 /____/____/____/||
/____/____/____/|||
|____|____|____|||/
|____|____|____||/
|____|____|____|/

5 2 3 ->
    ____ ____ ____ ____ ____
  /____/____/____/____/____/|
 /____/____/____/____/____/||
/____/____/____/____/____/||/
|____|____|____|____|____||/
|____|____|____|____|____|/

4 6 5 ->
      ____ ____ ____ ____
    /____/____/____/____/|
   /____/____/____/____/||
  /____/____/____/____/|||
 /____/____/____/____/||||
/____/____/____/____/|||||
|____|____|____|____||||||
|____|____|____|____|||||/
|____|____|____|____||||/
|____|____|____|____|||/
|____|____|____|____||/
|____|____|____|____|/

Shortest code wins.

I think it would look slightly better if the bottom-right piece was / instead of | so it matches the top, and the number of pipes in each vertical line be identical.

Also, what are the valid ranges for a, b, and c?  For example, are any of the dimensions allowed to be 0?

@stevether: I didn't think about "tiled cube", that's a better name.

@mellamokb: a>0,b>0,c>0. It probably would look better, let me change that.

A cube has equal edges. Better to call it a tiled parallelepiped or brick.

@DavidCarraher: Generally, a cube is an a-by-b-by-c block, when talking about tiled cubes.

@beary605  I'm not a mathematician, but I think you may be referring to a rectangular cuboid. (http://en.wikipedia.org/wiki/Cuboid) A cube, a particular type of rectangular cuboid, has square faces. (http://en.wikipedia.org/wiki/Cube) As far as I know, the name of the shape of the object doesn't change when the object is tiled.

@DavidCarraher: In the cubing community, cuboids are generally referred to as cubes (or a-by-b-by-c, which is a little more awkward), which is why I use the term.

@beary605 Ok. I wasn't aware of that. What's a cubing community, anyway?

@DavidCarraher: The people who speedsolve cube-styled puzzles.

Python, 145 chars
a,b,c=map(int,raw_input().split())
for i in range(b+c+1):print(' '*(c-i)+((' /|'[(i>c)+(i>0)]+'_'*4)*(a+1))[:-4]+('|'*(b+c-i))[:b]+'/')[:5*a+c+1]

$ echo "5 6 3" | ./cube.py
    ____ ____ ____ ____ ____
  /____/____/____/____/____/|
 /____/____/____/____/____/||
/____/____/____/____/____/|||
|____|____|____|____|____||||
|____|____|____|____|____||||
|____|____|____|____|____||||
|____|____|____|____|____|||/
|____|____|____|____|____||/
|____|____|____|____|____|/

Could we see a picture of the printout?

@DavidCarraher: done.

Mathematica 148 143 139 chars
I decided to use transparent glass tiles.
The following code prints ASCII characters "-" in the form of a cuboid with edges, a, b, and c. The only thing you see in the figure below are hyphens.
w_~e~_ := {Arrowheads@Table[{1, p/9, Graphics@Style[Text["-"], Red]}, {p, 9}], White,Arrow@w};
GridGraph[{a, b, c} + 1, VertexSize -> 0, EdgeShapeFunction -> e]

That's not ascii... cool idea, but no.

It was admittedly cheeky on my part. Thanks for the feedback.

C, 226, 212
s(x,y){x<1?:putchar(" |/_\n"[y],s(x-1,y));}i,j,x,y,z;main(){for(scanf("%d%d%d",&x,&y,&z);j<=y+z;s(i,1),s(j++>y,2),s(1,4)){s(z-j,0);for(i=x;s(1,j?j>z?1:2:0),i;i--)s(4,3);i=y+z-j;if(i>j)i=j;if(i>z)i=z;if(i>y)i=y;}}

Once again a poor score compared to other langs - so any C golf gurus able to improve?

Python3 (188)
a,b,c=map(int,input().split())
x=a+1
k="_"*4
p=print
l=5*a+c+1
p(" "*c+k.join(" "*x))
r=" "*c+k.join("/"*x)+"|"*b+"/"
exec("r=r[1:];p(r[:l]);"*c+'b-=1;p((k.join("|"*x)+"|"*b+"/")[:l]);'*b)

It is beaten already, but idea could help someone-else.

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


text:
Find the nth Fibonnaci Prime, in the shortest code
The challenge is rather simple:

Take a positive whole number \$n\$ as input.
Output the \$n\$th Fibonacci prime number, i.e. the \$n\$th Fibonacci number that is also prime.

Input can be as an parameter to a function (and the output will be the return value), or can be taken from the command line (and outputted there).
Note: Using built in prime checking functions or Fibonacci series generators is not allowed.
The first 10 Fibonacci primes are
[2, 3, 5, 13, 89, 233, 1597, 28657, 514229, 433494437]

Shortest code wins. Good luck!

possible duplicate of Fibonacci function or sequence

Is there a limit to the size?

@MrZander Size of what?

Size of input/output.  Do i need to account for prime_fib(1000000000000000000)?  Where is the limit?

@MrZander The algorithm should support arbitrarily large numbers, but the function may raise an out of bound exception if the result is too big for a normal int.

Ruby, 55
f=->n,a=1,b=2{n<1?a:f[n-(2..b).find{|f|b%f<1}/b,b,a+b]}

Calls itself recursively, keeping track of the last two numbers in the Fibonacci sequence in a and b, and how many primes it's seen so far with n. n gets decremented when the smallest factor greater than 1 of b, divided by b and rounded down to the nearest integer, is 1 rather than 0, which happens only for prime b. When it's seen all the primes it's supposed to, it prints a, which is the most recent b tested for primality.

C, 66
f(n,a,b){int i=2;while(a%i&&i++<a);return(n-=i==a)?f(n,b,a+b):a;}

I think you should define starting values of a and b inside your function.

Wouldn't a for loop be shorter? (I don't know C well)

Does one need the space after the return?

Can be reduced to 65 chars: f(n,a,b){int i=2;while(a%i&&i++<a);return(n-=i==a)?f(n,b,a+b):a;} - @ArtemIce: a= 1 and b= 2 worked for me.

@schnaader of course they worked, but code that sets a & b should be counted because it's codegolf

@schnaader - Thanks! Updated!
@Inkbug - for will be the same because of two ;s.
@ArtemIce - Question allows parameters.

@Gautam The question allows for n to be a parameter, but the start inputs for your fibonacci series should be part of the program and part of the character count.

Lacks initialisation code for a & b... So can you improve upon just adding g(n){f(n,1,2);}?

How does it work? :) I'm interested.

This is exponential time, by the way, without DP.

C, 85, 81, 76
f(n){int i=1,j=0,k;for(;n;n-=k==i)for(j=i-j,i+=j,k=2;i%k&&k++<i;);return i;}

borrowed code style of simplified prime number check from @Gautam
self contained C function (no globals)

Testing:
main(int n,char**v){printf("%d\n",f(atoi(v[1])));}

./a.out 10
433494437

./a.out 4
13

Mathematica, 59 or 63 bytes
(a=b=1;Do[While[{a,b}={b,a+b};Length@Divisors@b>2],{#}];b)&
(a=b=1;Do[While[{a,b}={b,a+b};b~Mod~Range@b~Count~0>2],{#}];b)&

These are unnamed functions which take n as their input and return the correct Fibonacci prime. The shorter version uses Divisors. I'm not entirely sure whether this is allowed, but the other Mathematica answer even uses FactorInteger.
The second one doesn't use any factorisation related functions at all, but instead counts the number of integers smaller than n which produce 0 in a modulo operation. Even this version beats all valid submissions, but I'm sure just posting this answer will cause some people to provide competitive answers in GolfScript, APL or J. ;)

Ruby, 94 68 67
n=->j{a=b=1
while j>0
a,b=b,a+b
(2...b).all?{|m|b%m>0}&&j-=1
end
b}

Clojure, 112
Ungolfed:
(defn nk [n]
  (nth
    (filter
      (fn[x] (every? #(> (rem x %) 0) (range 2 x)))    ; checks if number is prime
      ((fn z[a b] (lazy-seq (cons a (z b (+ a b))))) 1 2)) ; Fib seq starting from [1, 2]
    n)) ; get nth number

Golf: (defn q[n](nth(filter(fn[x](every? #(>(rem x %)0)(range 2 x)))((fn z[a b](lazy-seq(cons a(z b(+ a b)))))2 3))n))

Mathematica 147 143 141 chars
f@0 = 0; f@1 = 1; f@n_ := f[n - 1] + f[n - 2]
q@1 = False; q@n_ := FactorInteger@n~MatchQ~{{_, 1}}
p = {}; k = 1; While[Length@p < n, If[q@f@k, p~AppendTo~f[k]]; k++];p[[-1]]

f is the recursive definition of Fibonacci number.
q detects primes.
k is a Fibonacci prime iff q@f@k is True.
For n=10, output is 433494437.

oh god, induction...:shudders:

@acolyte It's fun to look at a trace of a function that calls itself.

Person: That was one of the courses that confirmed i needed to get the frak out of CompSci.

Haskell 108
p=2 : s [3,5..]  where
    s (p:xs) = p : s [x|x<-xs,rem x p /= 0]
f=0:1:(zipWith (+) f$tail f)
fp=intersect p f

To get nth number call it fp !! n.
EDIT:
Sic. Wrong answer, I fix it.

Husk, 15 bytes
!fȯ=2LḊ¡oΣ↑_2ḋ3

Try it online!

Groovy: 105 (134 with whitespaces)
b is the fibonacci function.
the closure inside the if is the prime check function. Update: a small fix on it
r is the prime fibonacci number.
r={ n->
  c=k=0
  while(1) {
    b={a->a<2?a:b(a-1)+b(a-2)}
    f=b k++
    if({z->z<3?:(2..<z).every{z%it}}(f)&&c++==n)return f
  }
}

Test cases:
assert r(0) == 0
assert r(1) == 1
assert r(2) == 1
assert r(3) == 2
assert r(4) == 3
assert r(5) == 5
assert r(6) == 13
assert r(7) == 89
assert r(8) == 233
assert r(9) == 1597

A readable version:
def fib(n) {
  n < 2 ? n : fib(n-1) + fib(n-2)
}
def prime(n) {
  n < 2 ?: (2..<n).every { n % it }
}
def primeFib(n) {
  primes = inc = 0
  while( 1 ) {
    f = fib inc++
    if (prime( f ) && primes++ == n) return f
  }
}

C, 105 (with spaces)
fibonacci implementation using dynamic programming:
long f(int n){int i;long b2=0,b1=1,n;if(n)return 0;for(i=2;i<n;i++){n=b1+b2;b2=b1;b1=n;}return b1+b2;}

Readable code:
long f(int n)
{
  int i;
  long back2 = 0, back1 = 1;
  long next;

  if ( n == 0 ) return 0;

  for ( i=2; i<n; i++ )
  {
    next  = back1 + back2;
    back2 = back1;
    back1 = next;
  }

  return back1 + back2;
}

How can this have 1 vote? Does not answer the question (no primality check) and the short version does not even compile

Pyth - 29 bytes
Loops Fibonacci until array is length n but only adds to array if prime.
J2K1W<lYQAJK,+KJJI!tPK~Y]K;eY

Kind of slow, but reached n=10 in ~15 seconds. Can probably be golfed more.
J2              J=2
K1              K=1
W        <lYQ   While length of array<input
 AJK,+KJJ       J,K=K+J,J
 I!tPK          If K prime(not builtin prime function, uses prime factorization)
  ~Y]K          append K to Y
;               End loop so next is printed
eY              last element of Y

Disclaimer: Pyth is newer than this challenge, so not competing.

Jelly, 15 bytes
0+⁸¡1
ÇÆḍ=1µ#ṪÇ

Try it online!
The version that uses builtins is 8 bytes. This is a direct translation of that answer, but with the builtins replaced. This takes input
How it works
0+⁸¡1 - Helper link. Takes k on the left
0     - Set 0 as the left argument
    1 - Set 1 as the right argument
  ⁸¡  - Repeat k times, updating the left and right arguments each time:
 +    -   Add
        This yields the kth Fibonacci number

ÇÆḍ=1µ#ṪÇ - Main link. Takes no input
     µ#Ṫ  - Read an integer n from STDIN and find the nth integer, k, in
            i = 0, 1, 2, ... for which the following is True:
Ç         -   The ith Fibonacci number
 Æḍ       -   Proper divisor count
   =1     -   Equals 1?
        Ç - Yield the kth Fibonacci number

CJam, 31 bytes
1_qi{{_@+_:T,{)T\%!}%:+2>}g}*\;

Try it online!
This is slow.
There is a builtin for primality checking. With that included, it runs much faster, and the size drops to 19 bytes (with the restriction that the supported maximum is 12, because CJam refuses to do a primality check on a BigInt).

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


text:
Working Week Completion
I work a standard nine to five. Monday through Friday. I take a half hour for lunch from 12:30 to 13:00.
Write me a program which, when run, calculates the percentage of the working week that I have completed at the current moment.
Rules

Only count time actually spent working. I am punctual and do not work
over lunch.
No input. You may obtain information like current time/date however is convenient.
The working week is considered complete from end-of-day Friday to midnight between Sunday and Monday.
Timezone is the local timezone.
Output should be a decimal number, eg 66.25498, percentage symbol optional.
The program should be reasonably future-proof. It should be able to cope with leap years.
Output resolution should be a second or better. I like to watch the kettle boil.
Code golf. Shortest code wins.

What's your time zone? System local? GMT? Oh, and is that midnight between Saturday and Sunday or Sunday and Monday?

I updated the rules. Local time, and the Sunday/Monday midnight.

Are you earning wages during lunch break?

I don't think that would make a difference?

if you are at lunch, you are not working, therefore, I guessed at a 37.5 hour work week

Given Fraxtil's solution, I'd like to ask for an official clarification on the minimum acceptable time resolution.

I think time resolution should really be a second or better. I'll amend the rules.

Q, 111 102
0|100*("i"$(27000000*((.z.d)mod 7)-2)+{0|((17:00:00&x)-09:00:00)-0|00:30:00&x-12:30:00}.z.t)%135000000

Python 3, 132
from datetime import*
t=datetime.now().timetuple()
m=max(0,t[3]*2+t[4]/30-18)
print(20*min(5,(t[6]+min(15,m-min(8,max(7,m))+7)/15)))

The resolution is one minute, or 2/45 of a percent. That's more than enough IMO.

Excel, 132, 129, 123,119, 117
paste into A2:A4
=NOW()
=A2-INT(A2)-.375
=(WEEKDAY(A2,3)*7.5+IF(A3<0,0,IF(A3>TIME(8,0,0),7.5,(A3-IF(A3>.1875,TIME(0,30,0),0))*24)))/37.5

format the cell A4 as % to get the correct format
40 hour workweek-Paid lunch:
88, 81
=NOW()
=A1-INT(A1)-.375
=(WEEKDAY(A1,3)*8+IF(A2<0,0,IF(A2>TIME(8,0,0),8,A2*24)))/40

The first does not appear to work when NOW() is a time after 5PM.

augh - a *24 in the wrong position.....

:-) BTW, good job besting me at my VBA approach using formulas instead. Now I'm nitpicking... Your update added a char (0) that isn't necessary!

my excuse is I haven't been at work after 5:00 for quite a while :D

Perl, 124 chars
OK, simple first solution to set the par:
say(($p=((($s,$m,$h,@t)=localtime)[6]+6)%7*20+(($h+=$m/60+$s/3600-9)<0?0:$h<3.5?$h:$h<4?3.5:$h<8?$h-.5:7.5)*8/3)<100?$p:100)

Run with perl -M5.010 to enable the Perl 5.10+ say feature.  Resolution is one second; if one minute resolution is acceptable, the +$s/3600 part can be deleted for a total length of 116 chars.
This solution uses localtime to get the day of week and the time of day, so it should work regardless of year changes, leap days or any other calendar peculiarities, at least as long as the seven day week cycle doesn't change.  DST changes during the workday would slightly confuse it, but those basically never happen anyway, presumably precisely because that would lead to way too much confusion.
(For testing convenience, note that localtime accepts a Unix timestamp as an optional argument.)

Mathematica  169 168 212 214 211 218 210 190 chars
Long-winded, by code golf Standards.
The following takes into account working weeks crossing month or year boundaries, as well as leap years.  It reckons time worked according to hours and minutes.
I couldn't think of a way to avoid spelling out the days of the week.  Mathematica returns day of week as a 3 character string, which has to be converted to a number.
h = Plus @@ {#1, #2/60, #3/3600} & @@ Take[DateList[], -3]; 100*Min[37.5, (StringTake[DateString[], 3] /. {"Mon" -> 0, "Tue" -> 1, "Wed" -> 2 , "Thu" -> 3, "Fri" -> 4, _ -> 5})*7.5 + Which[h < 12.5, Max[0, h - 9], h < 13, 4, True, 4 + Min[h - 13, 4]]]/37.5

De-golfed
(* d returns {year, mo, day, h, m, s}   *)
d = DateList[]

(* finished Days: hours worked *)
f = (StringTake[DateString[],  3] /. {"Mon" -> 0, "Tue" -> 1, "Wed" -> 2 , "Thu" -> 3, "Fri" -> 4, _ -> 5})*7.5

(* time of day in hours *)
h = Plus @@ {#1, #2/60} & @@ Take[d, -3]

(* today: hours Worked. It also computes hours for Sat and Sunday but does not use
them in the final tabulation, which has a maximum of 37.5. *)
t = Which[h < 12.5, Max[0, h - 9], h < 13, 4, _, 4 + Min[h - 13, 4]]

(* hours Worked in week *)
tot = Min[37.5, f + t]

(* % of working week completed *)
100*tot/37.5

VBA 141
Formatted to run from the immediate window. Thanks to Sean Cheshire for pointing out a 10-char improvement!
n=(Now-Int(Now))*24:a=(Weekday(Now,3)*7.5+IIf(n>17,7.5,IIf(n>9,IIf(n<12.5,n,IIf(n>13,n-.5,n))-9,0)))/37.5:MsgBox Format(IIf(a>1,1,a),".0%")

use n=n*24, and it can be reduced more. my fight with it produced this: n=(Now-Int(Now))*24:a=(Weekday(Now,3)*7.5+IIf(n>17,7.5,IIf(n>9,IIf(n<12.5,n,IIf(n>13,n-.5,n))-9,0)))/37.5:MsgBox Format(IIf(a>1,1,a),".0%") @ 139

@SeanCheshire Excellent point! My method had some left-over syntax from an earlier version that used n, so it couldn't be modified.

R, 115 chars
---------1---------2---------3---------4---------5---------6---------7---------8---------9---------0---------1---------2
T=as.POSIXlt(Sys.time()-86400);z=T$h+T$mi/60-9;D=function(x,M)min(M,max(0,x));D(((D(z,8)-D(z-3.5,.5))/7.5+T$w)/5,1)

Here is a one-week simulation:
week.frac <- function(t) {
   T <- as.POSIXlt(t-86400)
   z <- T$h+T$mi/60-9
   D <- function(x,M)min(M,max(0,x))
   D(((D(z,8)-D(z-3.5,.5))/7.5+T$w)/5,1)
}

time <- seq(from = as.POSIXlt(as.Date("2012-08-20")),
            to   = as.POSIXlt(as.Date("2012-08-27")),
            by   = "min")
week.completion <- sapply(time, week.frac)
plot(time, week.completion, type = "l")

Ruby, 191 116,115 113
The logic is stolen from Fraxtils Python solution.
t=Time.now
d=t.wday
m=[0,t.hour*2+t.min/3e1-18].max
p d<1?100:20*[5,(d-1+[15,m-[8,[7,m].max].min+7].min/15)].min

If you want to test the code with the unit test, you need this 143 character solution:
class Time
def r
m=[0,hour*2+min/3e1-18].max
d=wday
d<1?100:20*[5,(d-1+[15,m-[8,[7,m].max].min+7].min/15)].min
end
end
p Time.now.r

Not the shortest and most efficient code, but with a unit test ;)
The 191 characters include the newlines (I could make it a one-liner, just replace each newline with a ;).
class Time
def r
i=0
d{|t|i+=t.w}
i/1350.0
end
def d
t=dup
yield t-=1 until t.strftime('%w%T')=='109:00:00'
end
def w
h=hour
wday<1||wday>5||h<9||h>16||h==12&&min>29?0:1
end
end
p Time.now.r

And the testcode:
require 'test/unit'
class MyTest < Test::Unit::TestCase
  def test_mo
    assert_equal( 20, Time.new(2012,8,13,20).r) #monday
  end
  def test_tue
    assert_equal( 40, Time.new(2012,8,14,20).r) #tuesday
  end
  def test_wed_morning
    assert_equal( 40, Time.new(2012,8,15,7).r)
  end
  def test_wed
    assert_equal( 60, Time.new(2012,8,15,20).r)
  end
  def test_thu
    assert_equal( 80, Time.new(2012,8,16,20).r)
  end
  def test_fri
    assert_equal(100, Time.new(2012,8,17,20).r)
  end
  def test_sat
    assert_equal(100, Time.new(2012,8,18,20).r)
  end
  def test_sun
    assert_equal(100, Time.new(2012,8,19,20).r)
  end
  def test_middle
    assert_equal(50, Time.new(2012,8,15,13,15).r)
  end
end

Python 2  130 chars
from datetime import*
t=datetime.now().timetuple();
m=min
a=max
n=t[3]+t[4]/60.0
print m(17,a(9,n))-9-(a(0,m(.5,n-12.5)))+7.5*m(t[6],4)

Meh third attempt is weak sauce but I think I've gotten the logic right.

This doesn't work. At a quick glance of the output, there are no long periods of time where the percentage remains the same, which should be the case between each day's 5:00 PM to the following day's 9:00 AM, as well as each 12:30-1:00 PM interval. It also outputs negative numbers and numbers greater than 100 at times.

Oh, shame on me. You're absolutely right. Mulligan.

@Fraxtil I think I've edged you out by a hair

This appears to have a range of 0 to 37.5. It does pause during the appropriate intervals, though.

Oh I had it set to print out the number of hours for debugging. I forgot to change it over to % for answer. I'm guessing I won't be able to do that in 2 characters so I guess you got me after all

After from datetime import* you can simply use now(). And a=max is not economic (and m=min is useless).

@ugoren, your first point is incorrect. The full path to the method is datetime.datetime.now().

Am I miscounting or are we to count line returns/newlines as well? a=max is 4 char; I use max twice so you're right, that one's a wash but m=min is a saver because I call min() 3 times

@Fraxtil, I guess you're right, though I can't guess why it would be done so. Regarding newlines - all whitespace which can't be removed must be counted. You can't erase newlines here (without adding ;) so you have to count them.

@ugoren the datetime package also contains date and time classes so datetime.datetime... is needed to differentiate between them.

@ugoren also, is there a preferred way to count chars for codegolfing? I threw it into Word and went with their char count (for shame...) which appears to ignore non-printing characters in its character count.

@IamChuckB, I don't know a good method. Linux's wc can work, or you can marge all to one line (spaces instead of newlines) and use Notepad which shows the column number.


text:
Compile Regexes
In this task you have to write a program that reads a regular expression and generates another program that outputs whether an input string is accepted by that regular expression. The output must be a program written in the same language as your submission.
Input
The input is a regular expression r matching the following ABNF (the initial production rule is REGEX):
REGEX       = *( STAR / GROUP / LITERAL / ALTERNATIVE )
STAR        = REGEX '*'
GROUP       = '(' REGEX ')'
LITERAL     = ALPHA / DIGIT
ALTERNATIVE = REGEX '|' REGEX

If the input does  not match this grammar, the behavior of your program is undefined.
Interpretation
Interprete the input as a regular expression, where * is the Kleene-star (meaning repeat left argument zero or more times), | is an alternative, ( and ) group and no operator at all concatenated. Grouping takes precedence over star, star takes precedence over concatenation, concatenation takes precedence over alternative.
A string is said to be accepted if the regex matches the whole string.
Output
The program's output is another program written in the same language as your submission that reads a string s in an implementation defined way at runtime, outputs whether r accepts s and then terminates. Output may be done in a user-defined way although there must be only two distinct outputs for accepted and rejected programs.
You may assume that the input of your output program is never longer than 216-1 Bytes.
Restrictions
Neither your submission nor any program generated by your submission may use builtin functionality or libraries that

match regexes
transform regular expressions
compile regular expressions
generate parsers from a grammar
simplify the problem in a way that your submission becomes trivial

Scoring
The score of your submission is the number of characters it. The submission with the lowest score wins.
Testcases
All testcases contain a regular expression, a set of accepted strings, a set of rejected strings and an example program in C99 which is a valid output of a (hyptothetical) C99 submission.
(empty regular expression)
Accepted strings

(empty input)

Rejected strings

foo
bar
baz
quux

Example program
#include <stdio.h>

int main() {
    char input[65536];
    gets(input);

    return input[0] != 0;
}

(b|)(ab)*(a|) (a and b alternating)
accepted strings

a
ba
abababababa
abab

rejected strings

afba
foo
babba

example program
#include <stdio.h>

int main() {
  char input[65536];
  int state = 0;

  for (;;) switch (state) {
    case 0: switch (getchar()) {
      case 'a': state = 1; break;
      case 'b': state = 2; break;
      case EOF: return 0;
      default:  return 1;
    } break;
    case 1: switch (getchar()) {
      case 'b': state = 2; break;
      case EOF: return 0;
      default:  return 1;
    } break;
    case 2: switch (getchar()) {
      case 'a': state = 1; break;
      case EOF: return 0;
      default:  return 1;
    } break;
}

(0|1(0|1)*)(|A(0|1)*1) (binary floating point numbers)
accepted strings

10110100
0
1A00001

rejected strings

011
10A
1A00
100A010

I presume that having a program like return (regex.match(stdin) is not null) is not allowed.

You say that "The output must be a program written in the same language as the input", but the input is a regex. And the grammar you provide doesn't include the rule GROUP, which presumably defines literal brackets.

@Peter Sorry, I meant to write they same language as the submission.

@beary605 Yeah, you're right. See the section Restrictions: Neither your submission nor any program generated by your submission may use builtin functionality or libraries that match regexes (...).

I think your second example program is incorrect, it's missing a loop around the outer switch

Ruby, 641 651 543 characters
H=Hash.new{|h,k|[k]}
d=[[i=0,0,[]]]
o=[?(]
L="t,u,v=d.pop;q,r,s=d.pop;o.pop<?|&&(H[r]<<=t)||(H[q]<<=t;H[r]<<=u);d<<[q,u,s+v]"
gets.chop.chars.map{|c|c==?*&&(q,r,s=d.pop;H[r]|=[q,i+=1];d<<=[r,i,s];next)
eval(L)while/[|)]/=~c ?o[-1]>?(:o[-1]==?.
/[|(]/=~c&&d<<[i+=1,i,o<<c&&[]]||c!=?)&&d<<[i+=1,i+1,["s==#{o<<?.;i}&&c=='#{c}'&&#{i+=1}"]]||o[-1]=?.}
eval(L)while o.size>1
H.map{H.map{|k,v|v.map{|v|H[k]|=H[v]}}}
t,u,v=d[0]
$><<"s=#{H[t]};gets.chop.chars.map{|c|s=s.map{|s|#{v*'||'}}-[!0];#{H.map{|k,v|"s&[#{k}]!=[]&&s|=#{v}"}*?;}};p s&[#{u}]!=[]"

This ruby version became quite long because of several corner cases in the regex parser (maybe I should try a different approach). It expects the regular expression on STDIN and outputs the corresponding ruby code for the matcher to STDOUT.
The program directly generates code for a NFA-ε which is then executed in the matcher.
Test case 1:
(output includes additional newlines and indentation)
>>>

s=[0];
gets.chop.chars.map{|c|
  s=s.map{|s|}-[!0];
};
p s&[0]!=[]

Test case 2:
>>> (b|)(ab)*(a|)

s=[0, 1, 2, 4, 9, 5, 10, 6, 11, 12, 14];
gets.chop.chars.map{|c|
  s=s.map{|s|s==2&&c=='b'&&3||s==6&&c=='a'&&7||s==8&&c=='b'&&9||s==12&&c=='a'&&13}-[!0];
  s&[1]!=[]&&s|=[1, 2, 4, 9, 5, 10, 6, 11, 12, 14];
  s&[3]!=[]&&s|=[3, 4, 9, 5, 10, 6, 11, 12, 14];
  s&[0]!=[]&&s|=[0, 1, 2, 4, 9, 5, 10, 6, 11, 12, 14];
  s&[5]!=[]&&s|=[5, 6];
  s&[7]!=[]&&s|=[7, 8];
  s&[9]!=[]&&s|=[9, 5, 10, 6, 11, 12, 14];
  s&[4]!=[]&&s|=[4, 9, 5, 10, 6, 11, 12, 14];
  s&[11]!=[]&&s|=[11, 12, 14];
  s&[13]!=[]&&s|=[13, 14];
  s&[10]!=[]&&s|=[10, 11, 12, 14]
};
p s&[14]!=[]

Another example:
>>> a|bc

s=[0, 1, 3, 4];
gets.chop.chars.map{|c|
  s=s.map{|s|s==1&&c=='a'&&2||s==4&&c=='b'&&5||s==6&&c=='c'&&7}-[!0];
  s&[0]!=[]&&s|=[0, 1, 3, 4];
  s&[3]!=[]&&s|=[3, 4];
  s&[5]!=[]&&s|=[5, 6];
  s&[2]!=[]&&s|=[2, 7]
};
p s&[7]!=[]

Edit: Added a transition to fix the bug PleaseStand noted in the comments. Also changed initialisation of state.

Input 011 for regex (0|1(0|1)*)(|A(0|1)*1) results in true - it should be false.

@PleaseStand Fixed. Please see my edit.

C, 627 characters
This program treats its first command-line argument as the input and generates C code as its output.
#define A(v) F[v]+strlen(F[v])
#define S sprintf
char*B="&&f%d(s)||f%d(s)",*J="&&f%d(s+%d)",*r,F[256][65536];h=2;e(f,n,o,R,C,O,t,g){for(C=O=f;*r;++r)switch(*r){case 40:r++;e(g=h++,C=h++,0,0);r[1]^42?t=g:(t=C,S(A(t),B,g,C=h++),r++);o=!S(A(O),J,t,o);O=C;break;case 41:goto L;case'|':S(A(C),J,n,o);o=!S(A(O=f),"||1");break;default:r[1]^42?S(A(C),"&&s[%d]==%d",o++,*r,O^f||R++):(o=!S(A(O),J,t=h++,o),O=C=h++,g=h++,S(A(g),"&&*s==%d&&f%d(s+1)",*r++,t),S(A(t),B,g,C));}L:S(A(C),J,n,o);}main(int c,char**v){r=v[1];for(e(1,!S(*F,"&&!*s"),0,0);h--;)printf("f%d(char*s){return 1%s;}",h,F[h]);puts("main(int c,char**v){exit(f1(v[1]));}");}

Here is its output for (0|1(0|1)*)(|A(0|1)*1) (with newlines added):
f11(char*s){return 1&&s[0]==49&&f7(s+1);}
f10(char*s){return 1&&s[0]==48&&f9(s+1)||1&&s[0]==49&&f9(s+1);}
f9(char*s){return 1&&f10(s)||f11(s);}
f8(char*s){return 1&&f7(s+0)||1&&s[0]==65&&f9(s+1);}
f7(char*s){return 1&&f0(s+0);}
f6(char*s){return 1&&f2(s+0);}
f5(char*s){return 1&&s[0]==48&&f4(s+1)||1&&s[0]==49&&f4(s+1);}
f4(char*s){return 1&&f5(s)||f6(s);}
f3(char*s){return 1&&s[0]==48&&f2(s+1)||1&&s[0]==49&&f4(s+1);}
f2(char*s){return 1&&f8(s+0);}
f1(char*s){return 1&&f3(s+0);}
f0(char*s){return 1&&!*s;}
main(int c,char**v){exit(f1(v[1]));}

If you provide valid input as its first command-line argument, it returns exit status 1. Otherwise, it returns exit status 0.

$ ./regexcompiler '(0|1(0|1)*)(|A(0|1)*1)' > floatprog.c
  $ gcc -o floatprog floatprog.c
  floatprog.c: In function ‘main’:
  floatprog.c:1:519: warning: incompatible implicit declaration of built-in function ‘exit’ [enabled by default]
  $ ./floatprog '1A00001' && echo invalid || echo valid
  valid
  $ ./floatprog '100A010' && echo invalid || echo valid
  invalid

Either program, if you fail to provide the command-line argument, dereferences a null pointer, causing a segmentation fault. A sufficiently long regex will overflow the buffers of this  submission, and the size of input to a generated program is limited by the size of the stack. However, all the test cases work.
Note that e(g=h++,C=h++,0,0); introduces undefined behavior. If, for example, generated programs do not compile, you can try replacing the statement with h+=2;e(g=h-1,C=h-2,0,0);, which is five characters longer.

592 bytes


text:
Print custom alphabet
The Challenge
Display the alphabet from a given letter read from console input. If the letter is uppercase, you have to display the alphabet uppercased. The alphabet printed must end in the precedent letter of the one inserted. If an additiontal parameter is added to the input (a simple dot .) the alphabet should be printed one letter in each line. Otherwise, the alphabet should be printed in the same line, separed by a simple space. If wrong input is send to the program it will not print anything.
Inputs examples:
Input:
c

Program's ouput:
d e f g h i j k l m n o p q r s t u v w x y z a b

Input
H.

Program's ouput:
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
A
B
C
D
E
F
G

Sage Notebook operates at the "console level", so is the required "console input" in this case just typing the input into a worksheet cell?

shortest code wins?

@ardnew Yes, shortest code wins.

@r.e.s. I think that while you need to code the input reading of some way it can be fair from the rules perspective.

GolfScript has the advantage that i/o is done automatically via stdin/stdout (i.e., no code is required). To be fair, it seems to me that in other languages/environments something similar should be allowed: the means of providing input and output should not contribute to a code-golf score.

@r.e.s. GolfScript has so many advantages in these challenges (it's a languaje for this kind of things). How can we do this? A characters penalization for GolfScript? Maybe not for this challenge since it wasn't specified in from the beginning, but I can keep it in mind for the future challenges I post.

@Averroes The penalty for using GolfScript is the amount of time it takes to learn a language which has no real use outside of this kind of competition. I don't think penalising people for using the right tool for the job is going to be very productive.

@Gareth I agree. Nobody forces you to use any specific languaje to solve the problems nor participate, so if you want to do it you can freely choose the tool you want without penalization.

GolfScript 48 75 73 70 67 66 63 57 53
(91,65>.+.{32+}%+.@?>(;25<''+.,1>*\['''.']?[' 'n 0]=*

Online demos:

Test case 1 ('c')

Test case 2 ('H.')

Test case 3 (invalid input)

Update:
Now the last rule is also implemented. Thanks to Ventero for pointing out the issue.
Update:
I rewrote the code from scratch and found new ways to shorten it even further.
History of modifications:
.,3<\(:x;:§['''.']?)and{91,65>.+.{32+}%+.x?).{>25<''+{§n' 'if}%}{;;}if}''if
.,3<\(:x;:§['''.']?)*{91,65>.+.{32+}%+.x?).{>25<''+{§n' 'if}%}{;;}if}''if
.,3<\(:x;:§['''.']?)*{91,65>.+.{32+}%+.x?).!!@@>25<''+{§n' 'if}%*}''if
.,3<\(:x;:§['''.']?)*!!91,65>.+.{32+}%+.x?).!!@@>25<''+{§n' 'if}%**
.,3<\(:x;:§['''.']?)*91,65>.+.{32+}%+.x?).@@>25<''+{§n' 'if}%@@*!!*
.(@,3<@:§['''.']?)*91,65>.+.{32+}%+@1$?).@@>25<''+{§n' 'if}%@@*!!*
.(@,3<@:§['''.']?)*91,65>.+.{32+}%+@1$?):x>25<''+{§n' 'if}%\x*!!*
.(@,3<@:§['''.']?)*91,65>.+.{32+}%+@1$?):x>25<''+§n' 'if*\x*!!*
(\:§['''.']?)91,65>.+.{32+}%+@1$?):x>25<''+§n' 'if*\x*!!*
(91,65>.+.{32+}%+.@?>(;25<''+.,1>*\['''.']?[' 'n 0]=*

This solution does not follow the last requirement: If wrong input is send to the program it will not print anything.

@Ventero Right. I'll fix this.

63 - nice, we're head2head :), wish I could understand golfscript ;)

I feel the same way about Q. Great job! ;-)

+1 awesome! willing to break 50 ;-) ?

@bua Not yet. Only if you leave me no choice. ;-)

C, 135 129  128 chars
Damn, so many different magic numbers, but no way to get rid of them.
Has to be run with the input as program parameter. Now follows the "wrong input" requirement.
c;main(a,b)char**b;{if(a==2&&isalpha(**++b)&&!(c=1[*b])||c==46&&!2[*b])for(;++a<28;)printf("%c%c",**b-=**b+6&31?-1:25,c?10:32);}

Explanation:
c;                   // Variable that will be used later
main(a,b)char**b;{   // There's one parameter => a = 2, b[1] = the parameter
                     // Wrong input checks: We want...
  if(
     a==2 &&         // 1 parameter and ...
     isalpha(**++b)  // lower- or uppercase letter as parameter,
                     // increase b so we can access it better
     &&              // and ...
     !(c=1[*b]) ||   //   either no further character,
                     //     save the character in c, or...
     (c==46&&!2[*b]) //   a dot as next character and no further characters
    )                // if check succeeded, execute the for loop, else do nothing
  for(;++a<28;)      // This will loop 26 times (2..27)
    printf("%c%c",   // Print two characters
                     // First character to print:
      **b            // We'll print the first character of the parameter,
       -=            // but decrement it before printing
       **b+6&31?     // if the last five bits (31 = 11111b) are not 26 (6 == -26 mod 32)
        -1           //   decrement it by -1 (aka increment it)
        :25,         //   else (char=z/Z) decrement by 25, so we start over at a/A
                     // Second character to print:
      c?             // c is either ASCII 0 or a dot (ASCII 46)
       10            //   dot     -> print a newline
       :32);         //   ASCII 0 -> print a space (ASCII 32)
}

The **b+6&31 part uses the fact that the ASCII codes for lowercase/uppercase character are the same if only looking at the last 5 bits and the remaining 5 bits are in range 1..26.
Version without "wrong input" requirement (82 chars):
main(a,b)char**b;{for(b++;++a<28;)printf("%c%c",**b-=**b+6&31?-1:25,1[*b]?10:32);}

Any instruction on how to compile it? I get Segmentation fault when running.

@manatwork seems to take the input as parameter.

Yes, indeed, edited to clarify. E.g. if the program name is test, call it like test c or test X.

Thanks, got it. My C seems to be rustier than I thought.

K&R definition style can help: main(a,b)char**b;{. Also, one b++ would let you replace *b[1]->**b and b[1][1]->1[*b].

Thanks @ugoren, didn't know about the K&R style, very useful.

Ruby, 72 71 61 characters
gets;25.times{$><<$_=$_.succ[0]+=$1?$/:' '}if~/^[a-z](\.)?$/i

This ruby version uses a regular expression to verify the input. Fortunately, the Ruby string method succ does most of the work for us (including the wrap-around).
Edit: 61 characters with the help of chron and Ventero.

Mine ended up way too similar to yours to bother posting separately.  Same approach, but a few characters shorter (65): c=gets[0];25.times{$><<c.next![-1]+($1?$/:' ')}if~/^[a-z](\.)?$/i

And this is 62: gets;25.times{$><<$_=$_.next[0]+($1?$/:' ')}if~/^[a-z](\.)?$/i - basically the same as yours just abusing $_ and $/

@chron: Using += instead of +, you can drop the parentheses around $1?$/:' '.

@chron and Ventero: Thank you. Added your code to my solution.

Ruby: 127 113 92 (?) characters
(I can't find the rule about the penalty score on using -p. Added 1 for now. If wrong, please correct me.)
$_=if ~/^([a-z])(\.)?$/i;s,e=$1>?Z?[?a,?z]:[?A,?Z];[*$1.succ..e,*s...$1]*($2==?.?$/:" ")end

Sample run:
bash-4.2$ ruby -pe '$_=if ~/^([a-z])(\.)?$/i;s,e=$1>?Z?[?a,?z]:[?A,?Z];[*$1.succ..e,*s...$1]*($2==?.?$/:" ")end' <<< c
d e f g h i j k l m n o p q r s t u v w x y z a b

bash-4.2$ ruby -pe '$_=if ~/^([a-z])(\.)?$/i;s,e=$1>?Z?[?a,?z]:[?A,?Z];[*$1.succ..e,*s...$1]*($2==?.?$/:" ")end' <<< H.
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
A
B
C
D
E
F
G

bash-4.2$ ruby -pe '$_=if ~/^([a-z])(\.)?$/i;s,e=$1>?Z?[?a,?z]:[?A,?Z];[*$1.succ..e,*s...$1]*($2==?.?$/:" ")end' <<< seven

Ruby, 101 95
i,d=gets.split''
[*?a..?z].join[/#{i}/i]
($'+$`).chars{|c|$><<(i>?Z?c:c.upcase)+(d==?.?$/:' ')}

Try it online

Does not follow "If wrong input is send to the program it will not print anything."

could save a few chars with ('a'..'z').to_a => [*?a..?z]

@chron Thanks! How could I miss that..

Perl, 131 127 117 112 106 104 102 98 96 92 91 90 93 71 66 65 64 58 characters
s!^([a-z])(\.?)$!print chop,$2?$/:$"for($1..az)[1..25]!ie

Usage:
perl -ne 's!^([a-z])(\.?)$!print chop,$2?$/:$"for($1..az)[1..25]!ie'

One character has been added to the count for the n option.
Largest cut was only possible because of seeing the behaviour of ++ on characters in Jon Purdy's answer.

You can shave off a couple chars by removing the last 2 semicolons

this thing is impressive

@bua Thanks, I'm still trying to find the characters so that I can catch you and w0lf. :-)

s/a.$1/az/ to save 2 more.
chop().($2?$/:$") --> chop,$2?$/:$" for 4 more

GolfScript, 80 72 Characters
.).46={;)}*25,{65+.32+}%?)\""=*!!\([{)..31&26-!26*-}25*;]n+\"."=n" "if**

Lots of the code is testing for valid input and the "print nothing"-option. The actual logic is 37 characters only.
Test cases online

q/k4 66 64 63 60 58 56 + 2 penalty
penalty for global variable init, algorithm is 56 as below:
56:
if[&/x in".",l:(a;A)90>*x;1@/1_,/|_[0,l?x;l,'"  \n"@#x]]

58:
if[&/x in".",l:(a;A)90>*x;1@/(1_,/|_[0,l?x;l]),'"  \n"@#x]

change from if-else to if allowed to reorganize code and get rid of ";" at the end

60:
1@/$[&/x in".",l:(a;A)90>*x;1_,/|_[0,l?x;l];" "],'"  \n"@#x;

eventually got rid of this redundant check

63:
1@/$[&/x in".",l:(a;A)90>*x;1_,/|_[0,l?x;l];" "],'" \n""."in x;

print chars recursively instead a whole object
still can't get off identity comparsion x in "." in two places...  :(
semicolon at the end is required, otherwise print function (1@) would print it's return value to stdout.... damn

64:
2@,/$[&/x in".",l:(a;A)90>*x;1_,/|_[0,l?x;l];" "],'" \n""."in x;

EDIT:
Added penalty of 2 for global initialization(x:), same if wrapping function into brackets (as slackware suggested)
not sure if changing namespace should be punished as well...then it's another 3
(.Q`a`A) instead of (a;A)

Example:
q)\         - switch interpreter to k4
 \d .Q     - change to native namespace
  x:"c"
  if[&/x in".",l:(a;A)90>*x;1@/1_,/|_[0,l?x;l,'"  \n"@#x]]
d e f g h i j k l m n o p q r s t u v w x y z a b

  x:"@"
  if[&/x in".",l:(a;A)90>*x;1@/1_,/|_[0,l?x;l,'"  \n"@#x]]
  x:"H."
  if[&/x in".",l:(a;A)90>*x;1@/1_,/|_[0,l?x;l,'"  \n"@#x]]
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
A
B
C
D
E
F
G
  x:...

+1 Nice progress. I'll try to find another way to shorten my code now.

Can it really be called valid k if it's using definitions in q.k? ;-)
Also, if you wrap it in a function, you can skip the x:"a" setup step, eg {$[...]}

@slackwear you're right, that's why it's called q/k4 ;-).

Perl, 149, 167
Update

Added sanity check.
Took ardnew suggestion about the separator application.

exit if $ARGV[0] !~ /[a-z]\.?/i;    # sanity check input
($x,$d)=split //,$ARGV[0];          # split input arguments
@l=65..90;                          # define uc letter range
push @l,splice @l,0,ord(uc $x)-64;  # rotate letter range
pop @l;                             # remove the argument letter
print join $d?$/:$",                # print the joined list
  map {ord($x)>90?lc chr:chr} @l;   # map chr and lc as appropriate

you can replace $s=($d)?"\n":" "; with $s=$d?$/:$"; and maybe just get rid of $s altogether

Python, 83
r=raw_input()
i=ord(r[0])
exec"i+=1-26*(i%%32>25);print chr(i)%s;"%","["."in r:]*26

I'm not a fan of this restriction, but it exists and you program does not follow it: "If wrong input is send to the program it will not print anything."

Also, it looks like you print one character more than you should. The example output is 25 characters.

Mathematica 158 159 204 199 183 167 165 162
Code
f@h_ := Most@RotateLeft[#, Position[#, h][[1, 1]]] &[FromCharacterCode /@
        (65~Range~90 + 32 Boole@LowerCaseQ@h)];
g = Characters@# /. {{p_} :> Row[f@p, " "], {p_, "."} :> Column@f@p, _ -> ""} &

Usage
g["c"]
g["H"]
g["H."]
g["seven"]

Third usage case is f["H"] or f["H."]?

I had to fix the handling of ".", adding 50 chars to the code. But it now works according to the instructions

PHP, 120 119 113
<?$v=fgets(STDIN);$f=$c=$v[0];ctype_alpha($c++)||die;for(;$c[0]!=$f;$c=$c[0],$c++)echo$c[0],$v[1]=='.'?"\n":" ";

This is a [tag:code-golf] challenge, so speed and resource usage optimizations are not needed. Instead of storing $v[1]=='.'?"\n":" "'s result in variable $s, let PHP calculate it each time in the echo statement. That way you can spare 6 characters.

@manatwork Thank you, I changed it.

J   43
|:1j1#(25{.(u:,2#65 97+/i.26)(>:@i.}.[)])"0

Examples:
|:1j1#(25{.(u:,2#65 97+/i.26)(>:@i.}.[)])"0 's'

t u v w x y z a b c d e f g h i j k l m n o p q r
|:1j1#(25{.(u:,2#65 97+/i.26)(>:@i.}.[)])"0 's.'

t
u
v
w
x
y
z
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
|:1j1#(25{.(u:,2#65 97+/i.26)(>:@i.}.[)])"0 '['

This solution evolved on the J programming forum: http://jsoftware.com/pipermail/programming/2012-August/029072.html
Authors: AlvordBossCerovskiCyrEllerHuiLambertMcCormickMillerQuintanaSchottSherlockTaylorTherriault
Explanation
J phrases are executed starting on the right, passing the on-going result to the left as it gets evaluated.  Since it's interactive, we can look at pieces of the solution in isolation to better understand them.
The middle part generates the upper and lower case alphabet in Unicode:
   u:,2#65 97+/i.26
ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz

The " u: " verb converts its numeric right argument to Unicode characters.  The numeric argument is generated from the ASCII values for the upper- and lower-case characters by adding the numbers for "A" and "a" each to the values from 0 to 25 generated by "i.26":
   65 97+/i.26
65 66 67  68  69  70  71  72  73  74  75  76  77  78  79  80  81  82  83  84  85  86  87  88  89  90
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122

The right-hand portion,
   ((>:@i.}.[)])"0

looks up ( i. ) the position of the right argument ( ] ) in the left ( [ ) - which is the vector of letters above - and drops ( }. ) one more ( >: ) than that number.  The ' "0 ' applies this phrase to 0-dimensional (scalar) arguments.
   ('123H999' (>:@i.}.[)])"0 'H'
999

The " 25 {. " phrase takes the first 25 elements of the vector on the right.
The penultimate phrase " 1j1 # " on the left replicates its right argument according the number on the left.  A simple number does a simple replication:
   2 # 'ABCD'
AABBCCDD

However, a complex number - indicated by the " j " between the real and imaginary portions - inserts a fill element according to the imaginary part.  Here we indicate one fill element by the one to the right of the " j ".
   2j1 # 'ABCD'
AA BB CC DD

As with most J primitives, the replicate verb ( # ) works on numeric arrays in an analagous fashion to how it works on character arrays.  As shown here,
   1j1 # 1 2 3
1 0 2 0 3 0

we see that the default numeric fill element is zero whereas for characters it is the space character.
Finally, the leftmost token " |: " transposes the result of the preceding verbs to its right.
Explanation provided by Devon McCormick. Thank you Devon.

+1 Really nice solution and explanation. I considered trying it in J but couldn't figure a good way (a short way) to check that the input was valid. I think mine would have been at least twice as long as this.

Thanks Gareth, If you look at the early solutions in the discussion link, you will see many of our starts were longer. One of the neat things we found was the variety of approaches that we could use with J. cheers, bob

brainfuck, 303
,>,>++++++[-<-------->]<++[[-]+++++[->++++<]>++<]>++++++++++<<[->+>>>+<<<<]>>>>>>+++++++++++++++[-<++++++<<++++++>>>]<[<[->>]>[>>]<<-]<[[-]++++++++[-<++++>]]<<<[->>>+>+<<<<]>>>>>+[[-]<.<<<.>[->>>+>+<<<<]>>>[-<<<+>>>]<[->+>-<<]>[-<+>]+>[-<[-]>]<[++++[-<----->]<->]<+[->+>+<<]<[->+>-<<]>[-<+>]>>[-<<+>>]<]

Currently it doesn't support the If wrong input is send to the program it will not print anything part, and it can probably be shorter. I plan on fixing it later.  Right now my brain is too ****ed to continue.

C, 110
Sometimes prints "spaces" between letters, sometimes not.
i,j;main(int c,char*l){gets(l);l[1]&=10;j=*l%32;c=*l&~31;for(i=j;i<j+25;i++){l[0]=c+i%26+1;printf("%2s",l);}}

Slighly more readable:
i,j;
main(int c,char*l)
{
  gets(l);
  l[1]&=10;          // makes . to line feed and some other chars to "start of text"
                     // which looks like space in some cases
                     // (the byte can become either 0, 2, 8 or 10)

  j=*l%32;           // 0b 000c cccc, these five bits code which letter was chosen
  c=*l&~31;          // 0b ccc0 0000, these three bits code upper/lowercase

                     // 0b ccc0 0000 + (0b 000c cccc + [0..24])%26 + 1
  for(i=j;i<j+25;i++){l[0]=c+i%26+1;printf("%2s",l);}
}

Runs:
$ ./a.out
G
 H I J K L M N O P Q R S T U V W X Y Z A B C D E F

$ ./a.out
p.
q
r
s
t
u
v
w
x
y
z
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o

VBA 225
Formatted to run from the immediate window:
s=InputBox(""):n=Asc(Left(s,1)):l=Len(s):p=IIf(l<3,IIf(l=2,IIf(Right(s,1)=".",vbCr,"")," "),""):c=IIf(n>64 And n<91,65,IIf(n>96 And n<123,97,99)):o=n-c+1:If o>0 And p<>"" Then For i=o To o+24:x=x & Chr(i Mod 26+c) & p:Next:?x

Broken down into individual lines (needs to be surrounded by Sub block and needs a different print method to work in a module, thus making the code longer):
s=InputBox("")
n=Asc(Left(s,1))
l=Len(s)
p=IIf(l<3,IIf(l=2,IIf(Right(s,1)=".",vbCr,"")," "),"")
c=IIf(n>64 And n<91,65,IIf(n>96 And n<123,97,99))
o=n-c+1
If o>0 And p<>"" Then
For i=o To o+24
x=x & Chr(i Mod 26+c) & p
Next
End If 'Not needed when completed in single line format
MsgBox x

Perl, 77 76 70 68
chomp(($a,$b)=split//,<>);$"=$/if$b;map{++$a=~/(.)$/}1..25;print"@a"

Edits:

Saved a character using regex instead of substr.
Saved 6 characters using map instead of for.
Saved 2 characters by omitting final newline.

Nice, but as you've pointed out it doesn't meet the requirement that invalid input gives no output. Fix that and you'll get my upvote.

doesn't seem to work for me on perl 5.14.2. also i dont believe the \n in your final print is required, which will save a couple chars

@ardnew: I wrote it on my work computer, which has 5.12.3. Will kill the \n, thanks.

JavaScript, 137
Unfortunately a bit verbose (String.fromCharCode and charCodeAt).
for(x=b=(n=prompt(m={122:97,90:65})).charCodeAt(r='');/^[a-z]\.?$/i.test(n)&&(x=m[x]||x+1)!=b;)r+=String.fromCharCode(x)+(n[1]?"\n":" ");

R, 219
Ugly, long... still works.
f=function(l){if(!nchar(l)%in%c(1,2))invisible()else{s=ifelse(nchar(l)==1," ","\n");l=substr(l,1,1);v=letters;if(l%in%v){}else v=LETTERS;l=grep(l,v);if(l==26)cat(v[1:25],sep=s)else cat(c(v[l+1:(26-l)],v[1:l-1]),sep=s)}}

Usage:
f("a")
f("c.")
f("H")
f("z")
f("Z.")
f("seven")

C, 146 chars (terrible)
main(){char b[100];gets(b);for(char a=b[0],c=a,d=a&223,e=b[1];++c!=a&64<d&d<91&(!e|e==46&!b[2]);(c&31)>26?(c&=96):(putchar(c),putchar(e?10:32)));}

I'm not very experienced in C, which probably shows... >.<  I had a feeling that chars being integers would be helpful, but it didn't actually seem to make as big of an impact as I hoped...  I'll leave my attempt here though, feel free to suggest improvements.
Unminified version:
main() {
  char b[999]; // assume that the line will fit in 999 chars...
  gets(b);

  // a is the char we start on, c is the char that we iterate,
  // d is toUppercase(a), e is just an alias for the second char.
  for (char a = b[0], c = a, d = a&223, e=b[1];
      // increment c, make sure that we haven't reached a yet.
      // also check the other conditions (first char is letter, second char
      // is either '.' or NULL, third char is NULL if second char was '.').
      ++c != a & 64 < d & d < 91 & (!e | e == 46 & !b[2]);
      (c&31) > 26     // check if we need to wrap around
        ? (c &= 96)   // if so, wrap
        : (putchar(c), putchar(e?10:32))  // otherwise, print char & separator
  );
}

Java 8, 127 bytes
a->{String r="",d=a.length>1?"\n":" ";char c=a[0],C=c;for(;++c<(c<97?91:123);r+=c+d);for(c=C<97?64:'`';++c<C;r+=c+d);return r;}

Explanation:
Try it online.
a->{                        // Method with character-array parameter and String return-type
  String r="",              //  Result-String, starting empty
         d=a.length>1?      //  If the length of the input is larger than 1
            "\n"            //   Set the delimiter to a new-line
           :                //  Else:
            " ";            //   Set the delimiter to a space
  char c=a[0],              //  Get the input letter
       C=c;                 //  And create a copy of it
  for(;++c<(c<97?91:123);   //  Loop from this letter + 1 to (and including) 'Z'/'z'
    r+=c+d);                //   And append the result with a letter + the delimiter
  for(c=C<97?64:'`';++c<C;  //  Loop again from 'A'/'a' to (and excluding) the input-letter
    r+=c+d);                //   And append the result with a letter + the delimiter
  return r;}                //  Return the result

Mumps, 91, 86, 82,79,76
r t i t?1A.1"." s a=$A(t),p=a>90*32+65 f i=1:1:25 w *(a+i-p#26+p) w:t["." !

Not such a modern language ;) I'm sure there's a bit of optimization space left..
Explanation:
r t

read input
i t?1A.1"."

check if t matches the required input
s a=$A(t),p=a>90*32+65 f i=1:1:25 { w *(a+i-p#26+p) w:t["." !}

basic for loop through the alphabet. Note that mumps is strictly evaluating left to right. True=1, so you get 65 or 97 as a result for p, # is the modulo operator
tests:
USER>d ^golf
d.e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
a
b
c

USER>d ^golf
tuvwxyzabcdefghijklmnopqrs
USER>d ^golf
h.i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
a
b
c
d
e
f
g

USER>d ^golf
hallo
USER>

(you'll need a mumps runtime env, ie Caché to run this this)
edit: bold heading
edit: had a wrong solution, fixed now. Thanks to rtfs and Averroees for pointing this out

the code appears to be 79 chars in length, not 80

unfortunately the first space is not optional, so I thought I have to count it in.

The test cases doesn't ends in the precedent letter of the one passed as parameter, does them?

JavaScript: 141
c="",b=c[0].charCodeAt()<91,a="abcdefghijklmnopqrstuvwxyz",b&&(a=a.toUpperCase()),a=a.split(c[0]),a=a[1]+a[0],a=c[1]?a.split("").join("\n"):a

Commented version:
c="", //write input here (examples "a", "B", "c.", "D.")
b=c[0].charCodeAt()<91, //true for upperC, false for lowerC
a="abcdefghijklmnopqrstuvwxyz", //the abc
b&&(a=a.toUpperCase()), //if upper, turn main string to upperC
a=a.split(c[0]), //split by the first char of input
a=a[1]+a[0], //swap the two parts
a=c[1]?a.split("").join("\n"):a //if input second char, add breaklines in between
//the output is inside 'a'

jsFiddle DEMO

C (111)
main(int i, char**c){if(isalpha(*c[1]))for(i=0;i<25;i++) printf("%c",isalpha((*c[1])+1)?++*c[1]:(*c[1]-=25));}

dissection
if(isalpha(*c[1])) // start with char-check.

for(i=0;i<25;i++) // we need 25 values, excluding input char. reusing i.

printf("%c", // print char. ofcourse.

isalpha((*c[1])+1) ? ++*c[1] : (*c[1]-=25));
//check if we are past z/Z and fall back to a/A.
//make that available to print.

Works]$ ./test 5
Works]$ ./test W
XYZABCDEFGHIJKLMNOPQRSTUV
Works]$ ./test M NOPQRSTUVWXYZABCDEFGHIJKL
Works]$ ./test g hijklmnopqrstuvwxyzabcdef
Works]$ ./test [
Works]$ ./test a bcdefghijklmnopqrstuvwxyz
Works]$ ./test Z
ABCDEFGHIJKLMNOPQRSTUVWXY

Thank you for some food for thought.

You're not adding newlines if a '.' is given. Also, you should not output anything if the input isn't [A-Za-z]\.?, if I understood the question right.

#1. oh! i was engrossed in making code short..
#2. see the output of 'test [' it printss nothing.
@marinus

Here is my first attempt at it with APL.
⍞{1 1≡(2⌈⍴⍺)⍴⍺∊'.',⍵:⊃(~=/2⍴⍺)⌷(,X,' ')(X←25 1⍴1↓(X⍳⊃⍺)⌽X←(⎕A∊⍨⊃⍺)⌷2 26⍴⍵)}6↓26⌽⎕UCS 65+⍳58

if I can use a single global variable A←2 26⍴6↓26⌽⎕UCS 65+⍳58 then I can shorten the above down to the following:
{1 1≡(2⌈⍴⍵)⍴⍵∊'.',,A:⊃(~=/2⍴⍵)⌷(,X,' ')(X←25 1⍴1↓(X⍳⊃⍵)⌽X←(⎕A∊⍨⊃⍵)⌷A)}⍞

C++11
#include <iostream>
#include <vector>
#include <cstdio>

int main(int argc, const char * argv[])
{
    std::vector<char> list1,list2;
    for( char c = 'a'; c <='z'; c++ )
    {
        list1.push_back( c );
        list2.push_back( toupper( c ) );
    }
    char c = getchar();
    auto f = [ c ]( std::vector<char> list )
    {
        auto i = std::find( list.begin(), list.end(), c );
        if( i == list.end() )
            return;
        auto c = i;
        for( ;; )
        {
            c++;
            if( c == list.end() ) c = list.begin();
            if( c == i )break;
            std::cout<<*c<<"\n";
        }
    };
    f( list1 );f(list2);
    return 0;
}

Perl, 226 characters
die "Invalid input " if $ARGV[0] !~ /[a-z]\.?/i;
@listA=(a...z);
$index=ord(lc(substr($ARGV[0],0,1)))-97;
print join(substr($ARGV[0],1) ? "\n" : " ",map{$ARGV[0] =~ /[A-Z]/?uc $_:$_}(@listA[$index+1...25],@listA[0...$index]));

You can format your text to appear as a code block. Read the guide here to formatting your posts. Also, you can save some characters by using single character variable names.

An invalid input should print nothing, so your die statement can be reduced, saving a bunch...

C# 170
using System.Linq;namespace N{class P{static void Main(string[]a){foreach(char e in"abcdefghijklmnopqrstuvwxyz".ToCharArray().Where(o =>o>'c'))System.Console.Write(e);}}}

Uncompressed
using System.Linq;
namespace N {
    class P {
        static void Main(string[]a){
            foreach (char e in "abcdefghijklmnopqrstuvwxyz".ToCharArray().Where(o => o > 'c'))
                System.Console.Write(e);
        }
    }
}

Don't forget to add an explanation to your answer.

This program doesn't even by far try to play by the rules. 1: If the letter is uppercase, you have to display the alphabet uppercased. 2: The alphabet printed must end in the precedent letter of the one inserted. 3: If an additiontal parameter is added to the input (a simple dot .) the alphabet should be printed one letter in each line. Otherwise, the alphabet should be printed in the same line, separed by a simple space. 4:  If wrong input is send to the program it will not print anything. This is a 4-out-of-4 miss.

^ Other than that I urge you to take a look at my earlier comments here. You can replace char with var and shave 1 point of your score, loose the .ToCharArray() (a string is a char-array you can already iterate over!), lose the string[] a since you're not dealing with commandline arguments, lose the namespace, Your constant 'c' should be read from console input, lose the alphabet string and use ASCII instead etc. It's great that you play, but please try to make a decent effort; most submissions of yours seem to be trolling only.

C, 117
main(c,s,d){d=c=getchar(),s=getchar();for(s=s<0?32:s^46?0:10;d+=d+6&31?1:-25,s&&isalpha(c)&&d^c;printf("%c%c",d,s));}

Credit to schnaader for the d+6&31 trick.
http://ideone.com/ts1Gs9

Bash: 110 bytes
(([[ $1 =~ [a-z] ]]&&echo {a..z})||([[ $1 =~ [A-Z] ]]&&echo {A..Z}))|([ "${1:1:1}" = . ]&&sed 's/ /\n/g'||cat)

In terms of explanation, it's pretty straightforward, no magic tricks - this is just something that bash is intrinsically well suited for.  In terms of the non-obvious bits:

{a..z} is a very underused trick in bash - it expands to a b c d....  You can do the same to generate numerical sequences.
Bash can do regex matching, [[ $1 =~ [a-z] ]] runs a regex match against the first program argument for characters from a to z.  Likewise for A-Z.  You need double square brackets for it though, [ can't do it.
${1:1:1} gets a substring of $1 (the first argument), one character in, one character long - that is, it returns the second character of the string, what we expect to be ..
sed 's/ /\n/g' simple regex: searches and replaces spaces with newlines.  If . is the second character of the string, we pipe input to this, or otherwise...
cat is the final trick here - if we don't want to replace spaces with newlines, we feed stdin to cat instead which simply outputs it again.

Don't forget to add an explanation.


text:
Shortest undefined behavior sample in C++
What's the shortest, well-formed C++ code that exhibits undefined behavior?

What do you mean "runnable"? If it has UB, there's no guarantee it can be run.

@R.MartinhoFernandes well, I mean that it starts.

@LuchianGrigore that is very dependent on the compiler (version).

Define "exhibits". Does it need to show something? Or is it enough that the internal memory state is undefined at some point during the program?

defined "well-formed".

int main(){main;}

3.6.1 Main function [basic.start.main]
3 - [...] The function main shall not be used within a program.

Edit: this is diagnosable, so not UB.

int main(){for(;;);}

1.10 Multi-threaded executions and data races [intro.multithread]
24 - The implementation may assume that any thread will eventually do one of the following:
  — terminate,
  — make a call to a library I/O function,
  — access or modify a volatile object, or
  — perform a synchronization operation or an atomic operation.

int main(){int i=i;}

4.1 Lvalue-to-rvalue conversion [conv.lval]
1 - [...] If the object to which the glvalue refers is [...] uninitialized, a program
  that necessitates this conversion has undeﬁned behavior.

//^L.

Here ^L is the form feed character, which is part of the basic character set.  4 characters (a newline is not required per 2.2:2).  Undefined behaviour is per

2.8 Comments [lex.comment]
1 - If there is a
  form-feed or a vertical-tab character in [a //-style] comment, only white-space characters shall appear between it
  and the new-line that terminates the comment; no diagnostic is required.

the second one's not undefined. It can optimize out the for loop without issue. That is not undefined behavior.

@rubenvb http://stackoverflow.com/questions/3592557/optimizing-away-a-while1-in-c0x - anytime the standard says "the compiler may assume P," it is implied that a program which has the property not-P has undefined semantics.

yet the compiler may also assume no side effects when eliding copy constructors.

@rubenvb because that particular case is explicitly mentioned.

@rubenvb 12.8:31 says an implementation is allowed to omit the copy/move construction of a class
object, even if the copy/move constructor and/or destructor for the object have side eﬀects. "assume" is not in the language.

I believe the rule at §3.6.1 is diagnosable, so your first is ill-formed.

@Jerry is right. §3.6.1 has no mention that no diagnostic is required or that the behaviour is undefined. That makes it indeed diagnosable.

the for(;;) is exactly the loop I use in my embedded project..so not at all undefined, but rather strong, optimized and very useful

@BogdanAlexandru your embedded project has undefined behaviour.  That means that it might work as you expect now, but when you upgrade your compiler it will behave differently.

\u\
0000

This has eight characters, and has undefined behaviour, according to §2.2/1.

Each instance of a backslash character (\) immediately followed by a
  new-line character is deleted, splicing physical source lines to form
  logical source lines. Only the last backslash on any physical source
  line shall be eligible for being part of such a splice. If, as a
  result, a character sequence that matches the syntax of a
  universal-character-name is produced, the behavior is undefined.

this isn't & "program". A program has a main.

@rubenvb Try it on Hell++. It has undefined behaviour, so can be a program without a main. It's hard to enforce rules when you ask for a program that doesn't have any rules to follow (that's what UB means!).

Based on the wording of the question, I think this qualifies -- it asks only for the shortest "code" that displays UB. Based on the "runnable" in the comment, I think the intent, however, was the shortest program, which would rule out your code, because according to §3.6.1/1: "A program shall contain a global function called main, which is the designated start of the program." As such, without main, what you have is ill-formed.

@JerryCoffin He is using a freestanding environment where main is not required. You conveniently left out the rest of §3.6.1/1 which says "It is implementation-defined whether a program in a freestanding environment is required to define a main
function.". This is a valid program ("valid" as in it's a "program" according to your argument).

Dang, just came here to bring that one. +1

int main(){int i=1>>-1;}

Explanation:
C++98 and C++11 §5.8/1 both state that

The behavior is undefined if the right operand is negative, or greater than or equal to the length in bits of the promoted left operand.

on a 32-bit system, isnt the length in bits of int typically 32? changing the RHS of the shift to -1 is the same number of chars and won't depend on integer sizes

#include. /*Imagine a new-line right after the dot*/

§16.2/4:

A preprocessing directive of the form
             #include
  pp-tokens   new-line
(that does not match one of the two previous forms) is permitted. [..]
  If the directive resulting after all replacements does not match one
  of the two previous forms, the behavior is undefined.

Won't it parse the same if you remove the space before the dot?

@feersum Yep. That doesn't alter the idea, which is why I avoided it to enhance readability, but I guess it serves the point of the question to illustrate that the space can be omitted. Thanks!

If one is to believe wikipedia, here's a few:
Modifying strings is said to cause undefined behavior. It's always worked for me.
int main(int c,char*v){v[0]='.';}

A non-void function with no return causes undefined return values.
int a(){}
int main(){return a();}

Division (of int?) by zero is supposedly undefined. All I know is that it crashes.
int main(int c){c/0;}

These are not legal code snippets. Main must be defined as int main(){} at the very least.

Damn, I was sure the question was about C. Sorry about that.

@shiona the second parameter should be char ** not char *. You're merely modifying part of a pointer value. In fact, argv is guaranteed to be safely modifiable.

The standard allows string literals to be read-only, so many implementations do that.  It's correct for char *argv[] to not have any const qualifiers.  You could crash by writing into a string literal with int main(){char *v="";*v=1;}

int main() { int* a; return a[0]; }


text:
Convert Regexes
Suppose you have existing regexes you wish to compile using one of the submissions to Compile Regexes.
In as few characters as possible, write a program that:

accepts an existing regex as input, as either (a) one line from standard input; or (b) one argument from the command line; or (c) the contents of a textbox in a dialog box; then
converts the regex into one that works with the compiler (see "Equivalent constructs"); then
prints the new regex either (a) on standard output; or (b) in a dialog box.

Equivalent constructs
You can convert...

... the anchors ^ and $ to the empty string. If ^ is not at the beginning (and/or if $ is not at the end), prepend (and/or append) .*. (You may assume any ^ anchor is the first character of the regex and any $ anchor is the last character of the regex.)
... non-capturing groups to normal groups; replace (?:x) with (x).
... character classes; replace . with [0-9A-Za-z], \d with [0-9], and \D with [A-Za-z]. No character class will occur inside a bracket expression.
... bracket expressions to groups containing alternation. For example, [0-9A-FZ] can become (0|1|2|3|4|5|6|7|8|9|A|B|C|D|E|F|Z), and [^0A-Za-z] can become (1|2|3|4|5|6|7|8|9).
... the plus operator: + to {1,}.
... braces (x is the nearest character or group to the left):

x{m} to m × x.
x{m,} to m × x followed by x*.
x{m,n} to m × x followed by either of:

(n-m) × x?
(n-m) × (|x then (n-m) × )

... the question mark operator: x? to (|x) or (x|).

Special rules

You may assume all non-alphanumeric characters are metacharacters.
Do not use general-purpose or Unicode algorithms to compress your code.
Methods of input and output are implementation defined yet may not trivialize the solution.
Using a special-purpose regex parsing library is prohibited. However, using one or more regexes as a tool for parsing the regex is OK (see below Scoring section).
The input will never be longer than 1000 bytes.

Scoring
Generally, the score is the number of characters in your submission. However, you must double your score if you use a find-and-replace function and double it again if you use any regex or pattern matching function. When writing your program, carefully consider whether to use regex and/or pattern matching functions, as using one just once quadruples your score.
Test cases
Infinitely many valid outputs exist for each input case; thus, I have chosen a single example of possible output for each. The final test case is perhaps the trickiest.
Begins with "A"
 Input: ^A
Output: A(0|1|2|3|4|5|6|7|8|9|A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z|a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z)*

Valid: Abra, Absol, Aerodactyl, Aipom, Alakazam
Invalid: abra, absol, Bayleef, Beedrill

Contains "sex"
 Input: sex
Output: (0|1|2|3|4|5|6|7|8|9|A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z|a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z)*sex(0|1|2|3|4|5|6|7|8|9|A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z|a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z)*

Valid: partsexpress, sextet, middlesex
Invalid: partSEXpress, SEXtet, middleSEX

Any decimal integer
 Input: ^\d+$
Output: (0|1|2|3|4|5|6|7|8|9)(0|1|2|3|4|5|6|7|8|9)*

Valid: 0, 7, 51, 370, 1040, 65536, 007, 051, 0000370, 001040, 065536
Invalid: (the empty string), football, 10NIS

Decimal integer without leading zeroes
 Input: ^(0|[1-9]\d*)$
Output: (0|(1|2|3|4|5|6|7|8|9)(0|1|2|3|4|5|6|7|8|9)*)

Valid: 0, 7, 51, 370, 1040, 65536
Invalid: 007, 051, 0000370, 001040, 065536, football, 10NIS

Lowercase Q without U word
 Input: ^[a-tv-z]*q[a-tv-z]*$
Output: (a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|v|w|x|y|z)*q(a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|v|w|x|y|z)*

Valid: faqir, faqirs, qaid, qaids, qanat, qanats, qat, qats, qi, qindar, qindarka, qindars, qintar, qintars, qoph, qophs, qwerty, qwertys, sheqalim, sheqel, tranq, tranqs
Invalid: Faqir, qAid, quid, liquefy

Ends in a vowel then three or more consonants
 Input: [AEIOUaeiou][^0-9AEIOUaeiou]{3,}$
Output: (0|1|2|3|4|5|6|7|8|9|A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z|a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z)*(A|E|I|O|U|a|e|i|o|u)(B|C|D|F|G|H|J|K|L|M|N|P|Q|R|S|T|V|W|X|Y|Z|b|c|d|f|g|h|j|k|l|m|n|p|q|r|s|t|v|w|x|y|z)(B|C|D|F|G|H|J|K|L|M|N|P|Q|R|S|T|V|W|X|Y|Z|b|c|d|f|g|h|j|k|l|m|n|p|q|r|s|t|v|w|x|y|z)(B|C|D|F|G|H|J|K|L|M|N|P|Q|R|S|T|V|W|X|Y|Z|b|c|d|f|g|h|j|k|l|m|n|p|q|r|s|t|v|w|x|y|z)(B|C|D|F|G|H|J|K|L|M|N|P|Q|R|S|T|V|W|X|Y|Z|b|c|d|f|g|h|j|k|l|m|n|p|q|r|s|t|v|w|x|y|z)*

Valid: Bouncy, bouncy, erhythm
Invalid: Noisy, noisy, Dodge, rhythm

Exception to I before E, except after C
 Input: ^\D*([^Cc][Ee][Ii]|[Cc][Ii][Ee])\D*$
Output: (A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z|a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z)*((0|1|2|3|4|5|6|7|8|9|A|B|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z|a|b|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z)(E|e)(I|i)|(C|c)(I|i)(E|e))(A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z|a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z)*

Valid (and incorrectly spelled): AIRFEILD, AIRfeild, eyepeice, reciept, veiwer, zeitgiest
Valid (yet correctly spelled): forfeit, glacier, science, zeitgeist
Invalid (and correctly spelled): AIRFIELD, AIRfield, eyepiece, receipt, viewer
Invalid (yet incorrectly spelled): 6AIRFIELD, AIRFIELD0, forfiet, glaceir, sceince, zietgiest

U.S. amateur radio callsign
(Note that the FCC has reserved some of these (e.g. callsigns containing "SOS"), so not all of the matched callsigns could be legitimate callsigns used by U.S. amateur radio operators. 1x1 "special event" callsigns are not included.)
 Input: ^(?:[KNW]\d[A-Z]{2,3}|(?:A[A-L]|[KNW][A-Z])\d[A-Z]{1,2}|[KW][A-Z]\d[A-Z]{3})$
Output: ((K|N|W)(0|1|2|3|4|5|6|7|8|9)(A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z)(A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z)(|(A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z))|(A(A|B|C|D|E|F|G|H|I|J|K|L)|(K|N|W)(A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z))(0|1|2|3|4|5|6|7|8|9)(A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z)(|(A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z))|(K|W)(A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z)(0|1|2|3|4|5|6|7|8|9)(A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z)(A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z)(A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z))

Valid: W1AW, AB0C, AB2MH, NZ9WA, K9DOG, KL5CD, KA2DOG, KN0WCW
Invalid: WWVB, AB00, AM8ER, NZ99A, L9DOG, KNOWCW, KN0WCWW, kn0wcw

Should this be written as a program taking a line of input, a program taking a number of inputs, the function doing the actual work, or ?

@skibrianski: a complete program accepting a single regex on a single line; see update.

perl, 1111 916 bytes
There is more golfing to do, but under 1000 bytes seemed like a good stopping point, especially as no one else has answered this question yet =)
@l=("A".."Z","a".."z");@h=(0..9,@l);sub g{join"|",@_}sub p{length$_[0]>1&&substr($_[0],0,1)ne"("?"($_[0])":$_[0]}sub e{$e=$_[0];for(split//,$_[1]){return if$i[$e++]ne$_}1}sub x{push@o,$l=p g @_}$w=c("^.*\$");sub N{++$n}sub I{$i[$n]}sub c{@i=split//,shift;$f=$t=0;shift@i,$f=1 if$i[0]eq"^";pop@i,$t=1 if$i[-1]eq"\$";@o=();for($n=0;$n<@i;N){if(e$n,"(?:"){push@o,"(";N;N}elsif(e$n,"."){x@h}elsif(e$n,"\\d"){x 0..9;N}elsif(e$n,"\\D"){x@l;N}elsif(e$n,"["){N;my($v,@c);$v=1,N if"^"eq I;while(I ne"]"){push@c,$i[$n+1]eq"-"?I..$i[$n+=2]:I;N}@c=grep{$d=$_;!grep{$_ eq$d}@c}@h if$v;x @c}elsif(e$n,"?"){splice@o,-1,1,"(|$l)"}elsif(e$n,"+"){$l=p$l;splice@o,-1,1,"$l$l*"}elsif(e$n,"{"){N;my($j,$k,$h);$j.=$i[$n++]until","eq I||"}"eq I;if(","eq I){$h=1;$k.=I until$i[N]eq"}"}$l=p$l;@r=$l x$j;push@r,defined$k?"(|$l)"x($k-$j):"$l*"if$h;splice@o,-1,1,@r}else{x I}}push@o,$w if!$t;join"",$f?@o:($w,@o)}while(<>){chomp;print c($_).$/}

And here's a still-pretty-obfuscated, but at-least-it's-indented version:
use strict;
use warnings;

my @let = ('A'..'Z','a'..'z');
my @chars = (0..9,@let);

sub g { join('|',@_) }
sub p { length $_[0] > 1 && substr($_[0],0,1) ne '(' ? "($_[0])" : $_[0] };

sub comp {
  my @i = split//,shift;
  my ($front_anchor, $tail_anchor);
  if($i[0] eq '^') { shift @i; $front_anchor=1 }
  if($i[-1] eq '$') { pop @i; $tail_anchor=1 }
  my @out;
  my $last;
  for(my $n=0;$n<@i;++$n) {
    if($i[$n] eq '(' && $i[$n+1] eq '?' && $i[$n+2] eq ':') {
      push @out, '(';
      $n+=2;
    } elsif($i[$n] eq '.') {
      $last = g @chars;
      push @out, p $last;
    } elsif($i[$n] eq '\\' && $i[$n+1] eq 'd') {
      $last = g 0..9;
      push @out, p $last;
      ++$n;
    } elsif($i[$n] eq '\\' && $i[$n+1] eq 'D') {
      $last = g @let;
      push @out, p $last;
      ++$n;
    } elsif($i[$n] eq '[') {
      ++$n;
      my $invert=0;
      if($i[$n] eq '^') {
        $invert=1;
        ++$n;
      }
      my @c;
      do {
        if($i[$n+1] eq '-') {
          push @c, $i[$n]..$i[$n+2];
          $n+=2;
        } else {
          push @c, $i[$n];
        }
        ++$n;
      } while($i[$n] ne ']');
      @c = grep { my $c=$_; !grep { $_ eq $c } @c } @chars if $invert;
      $last = g @c;
      push @out, p $last;
    } elsif($i[$n] eq '?') {
      $last = "(|$last)";
      splice @out, -1, 1, $last;
    } elsif($i[$n] eq '+') {
      $last = p $last;
      $last = "$last$last*";
      splice @out, -1, 1, $last;
    } elsif($i[$n] eq '{') {
      ++$n;
      my ($bm, $bn, $hc);
      $bm .= $i[$n++] until $i[$n] eq ',' || $i[$n] eq '}';
      if($i[$n] eq ',') {
        $hc=1;
        $bn .= $i[$n] until $i[++$n] eq '}';
      }
      my @r;
      push @r, p $last for 1..$bm;
      push @r, p($last).'*' if $hc && !defined $bn;
      if($hc && defined $bn) {
        my $y = $bn - $bm;
        push @r, '(|'.p($last).')' for 1..$y;
      }
      splice @out, -1, 1, @r;
      undef $last; #no nested quantifiers
    } else {
      $last = $i[$n];
      push @out, $last;
    }
  }
  @out = (comp('^.*$'),@out) unless $front_anchor;
  @out = (@out,comp('^.*$')) unless $tail_anchor;
  return wantarray?@out:join"",@out;
}

while(<>) {
  chomp;
  print comp($_)."\n";
}


text:
Build a Simple Roguelike
This challenge is based on one proposed on the usenet group rec.games.roguelike.development a few years ago.  I can't find the original newsgroup post, but you can have a look a the Github repo of solutions.  It was only golfed in a couple of languages and I'd love to see some more!
Objective
The aim is to build a program that presents a top-down view of a dungeon using ascii characters.  There will be an @ sign representing the player that can be moved through the free space in the dungeon (represented by ), though it cannot pass through the walls (represented by #).
The map of the dungeon must look like this:
####  ####
#  #  #  #
#  ####  #
#        #
##      ##
 #      #
 #      #
##      ##
#        #
#  ####  #
#  #  #  #
####  ####

The player must begin at location {2,2}, where {0,0} is the top left-hand corner.
Interface
The user needs to be able to move the player in the four cardinal directions using the arrow keys on the keyboard.
There needs to be some way for the user to exit the program.  It does not need to be a graceful exit (for example, it doesn't matter if an exception is printed).
The map and player need to be drawn before any input has been taken, and the player needs to be updated after each input.
Libraries
Feel free to use established libraries for console input or output, such as Curses.  Just mention in your answer what you are using.
Scoring
This is code golf, shortest code wins!

Pretty close to a duplicate of Build an engine for a maze game which could certainly use some additional entries. Thoughts?

@dmckee It's definitely pretty similar.  I hope the simpler input mechanism and the challenge of efficiently hardcoding the preset map will make it different enough.

I'll certainly buy the hardcoded map bit. Now just let me just think on how I might adapt my previous solution...

I just can't help but mention the game that introduced me to C: http://www.nethack.org/

C, 257 253 222 220
Uses system("cls") instead of curses (use system("clear") for Linux systems) and a clever algorithm to fit the map into an 8-digit number. Non-extended keys end the program, e.g. escape.
EDIT: Now also shows your hero below the map by using a<230 instead of a<132:
    ##
   ####
 ###  ###
 # #  # #
## #  # ##
   ####
  #    #
 ##    ##

Code:
a,p=14,w=11,X,Y;m(I){X=I%w-1,Y=I/w;return 70313263>>(Y>5?w-Y:Y)*5+(X>4?9-X:X)&1;}main(){do{system("cls");a=a&4?1:a&2?-1:a&8?-w:w;p+=!m(p+a)*a;for(a=0;++a<230;)putch(a%w?a-p?m(a)*35:64:10);}while(a=getch()>>7?getch():0);}

This doesn't compile for me.

Compiles and works for me using Visual Studio 2008.

@Matt: Hm.. I successfully tried both MinGW (gcc 4.6.1) and MSVC (VS 2009) under Windows so far. What's the error message?

@schnaader in gcc 4.4.5 I get:
test.c:(.text+0x1a1): undefined reference to `putch'. I get the same error for getch

For putch, there's putchar which does the same, but I don't know how to replace getch - there's a getchar too, but it doesn't work for me - seems it doesn't recognize the cursor keys.

Update: Tried all alternatives I can think of for getch - getchar, scanf, fgetc, fgets, but none handles extended key codes correctly. @Matt: Does adding #include <conio.h> (followed by a newline) to the beginning work for you?

@schnaader replacing all instances of putch with putchar results in an incorrectly drawn map. I don't have conio.h so I can't test that. I don't actually care too much if it works for me since someone else verified it.

Ruby 1.9 + Curses (248)
require'curses';include Curses;noecho;curs_set 0
b=0xf3e499e601c0d0240b0380679927cf.to_s(2).tr'01',' #'
s=init_screen<<b.scan(/.{10}/)*$/;s.keypad 1
p=22;d=->t=?@{setpos p/10,p%10;addch t;6};d[]
loop{p=b[v=p+[10,-10,-1,1][getch%d[32]]]<?#?v:p;d[]}

That uses a map different from the specified one. I recommend using 0xf3e499e601c0d0240b0380679927cf instead.

Python 332 319 317
from curses import*
M=0xf3e499e601c0d0240b0380679927cf;S=initscr();S.keypad(1);x,y=2,2;A=S.addstr;[A(a,b,[' ','#'][M>>(10*a+b)&1])for a in range(12)for b in range(10)]
while 1:A(y,x,'@');k=S.getch();A(y,x,' ');X=[[x,x-1],[x+1,1]][k==261][k==260];Y=[[y,y-1],[y+1,y+1]][k==258][k==259];x,y=[(X,Y),(x,y)][M>>(10*Y+X)&1]

The python curses library is only officially supported on linux. There are unofficial ones available for windows, but I can't guarantee that this will work with it.
To save a few characters I hard coded the keycodes for up, down, left, and right. This may cause problems for some people. If this doesn't work for anyone I can post a version that should.
Use ctrl+c to exit. You will probably have to reset your terminal after exiting, but the challenge specifically said the exit didn't have to be graceful.

QBasic, 314 313 bytes
This sort of problem simply begs for a QBasic solution.
DIM w(12,10)
FOR r=1TO 12
READ d
FOR c=1TO 10
w(r,c)=(d*2AND 2^c)>0
?CHR$(35+3*w(r,c));
NEXT
?
NEXT
i=3
j=3
1LOCATE i,j
?"@"
a$=""
9a$=INKEY$
IF""=a$GOTO 9
k=ASC(RIGHT$(a$,1))
x=i+(k=72)-(k=80)
y=j+(k=75)-(k=77)
LOCATE i,j
?" "
IF w(x,y)THEN i=x:j=y
IF k>9GOTO 1
DATA 48,438,390,510,252,765,765,252,510,390,438,48

This is golfed QBasic, which will be expanded significantly by the autoformatter. But, if you type this exact code into the IDE and hit F5, it should run. Tested on QB64.

Explanation:
The map is encoded row-wise as the bits of the integers in the DATA statement (1 for space, 0 for wall). The nested FOR loop unpacks them, storing truth values in the 2D array w, and printing # or   accordingly. (Note that true in QBasic is -1, thus why we're adding to 35 instead of subtracting!) The player starts at 3,3 because most things are 1-indexed in QBasic.
We then enter a GOTO loop: print the @, get keyboard input, convert to extended character code, and modify x and y based on whether the user pressed L/U/R/D. If w(x,y) is true, then it's a space and we can move there; otherwise, stay put. Finally, the shortest way I found to exit is by pressing the tab key (ASCII 9). Any other input loops us back up to the first LOCATE statement.
I must say, I'm rather tickled to have beaten Python with a QBasic answer.