Hexadecimal To Decimal
Ruby, 74 characters
n=0;p gets.gsub(/./).all?{|x|n=n*16+(x&gt;?9?9:0)+x.ord%16;/[\da-f]/i=~x}?n:0

Input must be given on STDIN. With command line option -ln (counted as 4) it can be shortened to 69 characters.
n=0;p chars.all?{|x|n=n*16+(x&gt;?9?9:0)+x.ord%16;/[\da-f]/i=~x}?n:0