text:
Recognise Stack Exchange Sites by Their Icon
After spending a while on Stack Exchange, I can recognise most sites in the Hot Network Questions by their little icon (which is also their favicon), but certainly not all of them. Let's write a program which can! You're to write code which determines the site, given one of the (currently) 132 favicons, including Stack Overflow in Japanese (which is still in private beta):

I've uploaded a ZIP file with all these images as PNGs on GitHub. Click the "Raw" button to download it. The order of the above icons is the alphabetical order of the file names in the zip.
The corresponding site names (in this order) are:

Academia
Android Enthusiasts
Anime & Manga
Ask Different
Arduino
Ask Ubuntu
Astronomy
Aviation
Video Production
Beer
Bicycles
Biology
Bitcoin
Blender
Board & Card Games
Stack Overflow in Portuguese
LEGO Answers
Buddhism
Chemistry
Chess
Chinese Language
Christianity
Programming Puzzles & Code Golf
Code Review
Cognitive Sciences
Community Building
Seasoned Advice
Craft CMS
Cryptography
Computer Science
Theoretical Computer Science
Data Science
Database Administrators
Home Improvement
Drupal Answers
Signal Processing
Earth Science
Ebooks
Economics
Electrical Engineering
English Language Learners
Emacs
English Language & Usage
Expatriates
ExpressionEngine Answers
Physical Fitness
Freelancing
French Language
Game Development
Arqade
Gardening & Landscaping
Genealogy & Family History
German Language
Geographic Information Systems
Graphic Design
Amateur Radio
Biblical Hermeneutics
Hinduism
History
Homebrewing
History of Science and Math
Islam
Italian Language
Stack Overflow in Japanese
Japanese Language
Joomla
Mi Yodeya
Linguistics
Magento
Martial Arts
Mathematics
Mathematics Educators
Mathematica
MathOverflow
Motor Vehicle Maintenance & Repair
Meta Stack Exchange
Personal Finance & Money
Movies & TV
Music, Practice & Theory
Network Engineering
Open Data
The Great Outdoors
Parenting
Ask Patents
Pets
Philosophy
Photography
Physics
Project Management
Poker
Politics
Personal Productivity
Programmers
Puzzling
Quantitative Finance
Raspberry Pi
Reverse Engineering
Robotics
Role-playing Games
Russian Language
Salesforce
Computational Science
Science Fiction & Fantasy
Information Security
Server Fault
SharePoint
Skeptics
Software Recommendations
Sound Design
Space Exploration
Spanish Language
Sports
Software Quality Assurance & Testing
Stack Apps
Stack Overflow
Startups
Cross Validated
Super User
Sustainable Living
TeX - LaTeX
Tor
Travel
Tridion
Unix & Linux
User Experience
Web Applications
Webmasters
Windows Phone
WordPress Development
The Workplace
Worldbuilding
Writers

Notes:

I've removed the ® from LEGO® Answers and ExpressionEngine® Answers, so you don't have to worry about Unicode.
I've used English names for the Stack Overflows in Japanese and Portuguese for the same reason.
The icons of Earth Science and Spanish Language are indistinguishable. Therefore, given one of these icons, your code may return either of those sites (of your choosing). The same goes for Magento and Martial Arts.

Rules
You may write a program or function which

receives the (local) file name of the image via STDIN, command-line argument or function argument or receives the image file's contents via STDIN
returns or prints to STDOUT the name of the site, as listed above.

Your code must recognise all 132 sites correctly (with the exception mentioned above).
You may not make any assumptions about the file name (like that it's called codegolf.png). You may assume that the image has dimensions 16x16, and that it will indeed be one of the 132 images above. The above images are all PNGs, but you may use any other convenient raster graphics format, but you'll have to convert the images yourself. You should not make any assumptions about the actual byte stream of the image file, other than that it's a valid image in whatever format you chose. In particular, if there are multiple ways to encode the same image in your format (e.g. by adding irrelevant fields to the header section), your code must work for all of them. In short, your code should only rely on the pixel values themselves, no details of the file encoding it.
As usual, you may not fetch any data from the internet. You have to determine the site from the image alone.
You may use built-in or third-party functions to read the image file and get a list of colour values, but you must not use any other existing image processing functions.
This is code golf, so the shortest answer (in bytes) wins.

CRC32 is shorter than MD5. Anyone who knows an even shorter checksum algorithm will probably win.

@manatwork You'd still have to turn that into a short value to look up the strings and compress the lookup table. And I'd wager that writing your own clever hash in a terse language could be shorter than calling a built-in hashing function and shortening the resulting hash in a "normal" language.

What is the expected behavior in case of no matching site is found? Or should we assume the image will be always a valid site icon?

@manatwork Yes, you can assume that the input will be one of those 132 images.

Do we need to examine the actual pixels, or is it sufficient to generate a hash from the raw PNG data?

@squeamishossifrage You may generate a hash from the pixel values. I don't know how flexible the PNG format is, but whatever format you choose, if there are two different files that encode the exact same image, your program has to work for both of them. So you might not be able to make any assumptions about the precise byte stream from the image file, other than it's a valid image in whatever format you chose. I should clarify that.

@MartinBüttner Yes there can be two different PNGs that encode the same image, otherwise pngcrush will not exist.

I feel that this could be done amazingly with a decision tree that analyses pixels at specific co-ordinates in the image...  I'm sure there's some simple ML technique to identify the "key features" that can be used to distinguish the images...  Time to dig out my ML notes!

@MarkKCowan Look at my solution, I basically do that. For every pixel, I make a list of the different color values it has in all the images. Then I pick the median value, and split the images on two depending on their color in that pixel. Then do the same recursively to the two halves until you're down to a single image.

@TomvanderZanden: Nice, binary search on images :D  Somewhat simpler and more elegant than my idea, for pretty much the same effect!

@Martin, I found that the icons of Earth Science and Spanish Language have different bitmaps. The CRC32 of the pixel arrays are different. But as far as I can tell, the pixels for Magento and Martial Arts are identical as you have stated.

@CarpetPython Yes, Earth Science and Spanish Language are different when taking the alpha channel into account. I had intended to remove the alpha channel, but I messed that up, so those two are actually distinguishable.

How long did it take to make this post with all those image files?

Optimizer wrote a JS snippet to scrape all their URLs. Then I wrote a script in Mathematica to download them, extract the 16x16 version and save them as PNGs with the correct file name on my hard drive. And then, yes, I had to drag and drop all 132 of them one by one into the browser window so SE uploads them to imgur.

I wonder how many of those sites still have the same favicon 3 year's later...

Python 3.x + Pillow, 2301 1894 1878 bytes
import sys,re,zlib as z,base64,PIL.Image as i
print(re.search(str(z.adler32(i.open(sys.argv[1]).tobytes()[2::6])%2003)+'(\\D+)',z.decompress(base64.b85decode(b'c${Tc%XZ>86#NyfdNqBH<%b?iLI_EpFkwO-GfQC$tcfjoB$+h*^;0s?o$g*?uzgjxs%~BKif!C3zALZEU!&?wJd#-mqgS@p<P&+)AsV|c*52*C>U&(1_4w^urvvWJU8Bj;bvv4ia;eiJLu+bsXLru`DjH|W<`|;xLq++kv5k8VWZgQe*`_u+opEF8>A6qjM%k#skzbiuJ7dL_*><K@9l6!M*H(|w)PZJ2`RYy7K2VVrv+zc)&2Fc?wvh|^#ksyymE?D!Q$3!LbFX%h%vT%1#lr486Iybw?0!`H)ZlZ#XIao2uXTr}(IBl@wRWHa#})bgV);O3HoW7+T*!5M3=^mu6Ri$`7L;uUWj~gsqR6gQR9h7^nKdBIgy>ats36%|M|8p1x;32(ZfK9R5_xK5ts=Sz70c%SIK&g3N1E|sg{n3>JSbKwwhssGcb$8uMNw=Nv;f_;rj?}kz(3-&#FQw@O;q(8nGHjbrTC(NQv=ckXT|eHr|amahCq(7T6<LBTr5Gj>fHV~3DcYINN!Qr`6Dl?jT>!4u5~bb%Zi6VTax;%vg*m325J_$nEC%yqbbYeEp!K_K7k)W-XCP`6+}N7tktMVX+{@c2L&kLAc&IvspGrzZ$F`uOBg}fA3W2neAU}tg~<+iCN=<sR^Zke+9WNhnCyy6!8nfa>33&OWiPt2s=OMTrUgilSYQxrG!gziB!Aj83zX&6S|yjIQkA?iF0n%?<+B=%_D11aoCv?@Q&eei{sqNkr7RG`#*xyzSUE6BUNnZK)3|3Wls}K$qaKv;jOO#!{3Ms)4CQ?shafnAF^zVq(`K9o2xL5JoQoGea+W1$+xmw&8OMOtN1Pid6UAcd+*_bB6IY$KjrO=ac^tPv3(8O`&(agOBbT{Va6s}Rm9&`I#yivC;MhW8=n+^^&Reho;~!~W<xgH6bVq3^=H7)sUXV2nv~DP4`CY`f55i&qH)DvPMQy>)y*Z=|68w@v=#oo5^RSh5R2F%1-vt>h=|+1n0pE^Yq-72!)1+o{hD_3<Cyxpyr6r%cei-AFQ*h1seM$MP>ovLS2k#Ci$to#do$s3MXu2lZsw~9HkbjVWM@1!{w>}LWVj#j2qC(+*Okc>=<qcV}*}+U_QK+(ZZ(x>ZMdDDWtgHiBK+7p6aHHI`u-h6z7|Xm`>D1t4uEp271y7oCI^{1^H~O7QRxTA_U&92Q8z$J2O|5Lbeg_0umd^pSU<%-ki7LtDvo&AgIt0h~6(y@Hr+kyLJ$<B#07KdGob0EW$7@f{GszaUv#tkpSyk759Khmvq-aiyM-_&x_VCTx$Vy<;$<k{T$-@{Mhc<<%KD1AHK^MKkg%pYIW}SxhV?&a{o9=rs@*+hqyoioE=TF>9S<KxY+^69^OA0jkS#0!w@kw4}KTcP9#+PVW+qB|7B`Y?eRs+7}8RSAs?i?-Cz#Wp(Iihd`nI!Q_i%R^o_;fvDQ5|{Cr;yWeirL>_l#(wn)$QenJkK6Sgw)5NleBzvo&G#@>X`7Ib*aS4LHx9epI%BXXV&y7LJ&54g}D25-Q8>DZQ5hGKyIeJkQQu08%j|<x~)q(AOVw9P~Z*c0Z@VM6n#<}tBT6+T%4mZ9f*y76xlEFM~o$xr9*SZHd^6D-C!pkkp3m(-~W3&>KY@106L+;I><MJ^Dz`f{(I3i?u`2pWjUjlwZx`B1JB#h#u3xTH*b1K?TG40|4lxF1$_Pw+t?h2')).decode()).group(1))

The idea is hash the image and find the corresponding string from a dictionary (just like other answers).
The key code is this:
adler32(open(sys.argv[1]).tobytes()[2::6])%2003

We open the file, and then convert it into a 1024-byte string of RGBA values. With a bit of experimentation, we find that the ADLER-32 checksum of every sixth byte of this byte string is unique for these 132 images. And then further testing shows that, taking modulus of 2003 of the checksum gives the smallest dictionary.
The original dictionary looks like:
{
    3: 'Programming Puzzles & Code Golf',
    6: 'Science Fiction & Fantasy',
    7: 'Bitcoin',
    8: 'Biblical Hermeneutics',
    …,
    1969: 'Unix & Linux',
    1989: 'WordPress Development',
    1993: 'Cognitive Sciences',
    2001: 'Personal Productivity',
}

We noticed that all site names do not contain numbers. Therefore we could concatenate the whole dictionary into a single string:
"256Software Quality Assurance & Testing3Programming Puzzles & Code Golf1284Geographic Info…"

And then use the regex e.g. 1969(\D+) to extract the site name. This huge string is then compressed to save space (let the compression engine notice the multiple occurrences of "Language"), and finally base-85 encoded.

Since it is now also tagged as kolmogorov-complexity, here a 2394-byte solution that does not use compression (zlib is still imported for adler32).
import sys,re,zlib,PIL.Image as i
l=' Language'
s='Science'
print(re.search(str(zlib.adler32(i.open(sys.argv[1]).tobytes()[2::6])%2003)+'(\\D+)','256Software Quality Assurance & Testing3Programming Puzzles & Code Golf1284Geographic Information Systems517Windows Phone6'+s+' Fiction & Fantasy7Bitcoin8Biblical Hermeneutics1034Writers1803Ask Different781Joomla597Islam1809Craft CMS878English'+l+' & Usage431Freelancing1565Politics32LEGO Answers289Physical Fitness1316Spanish'+l+'1830Database Administrators296Pets1066Philosophy1582Ask Patents560Cryptography1073Magento1588MathOverflow1333Salesforce1591Linguistics1844Stack Apps948Japanese'+l+'572Electrical Engineering778Genealogy & Family History735Sound Design63Open Data505Tridion328Arqade1609Hinduism588Music, Practice & Theory1101Expatriates846Network Engineering79German'+l+'1104Webmasters1208Signal Processing118Puzzling867ExpressionEngine Answers654Buddhism1593Quantitative Finance1625Parenting859Biology1117Academia1118Stack Overflow353Project Management1123Motor Vehicle Maintenance & Repair612Chinese'+l+'876Startups877Video Production110Reverse Engineering701French'+l+'677Bicycles1683Ebooks1908Blender190Physics1654Beer119History of '+s+' and Math1913Android Enthusiasts634Chemistry1252Travel1148Cross Validated1662Italian'+l+'565Sustainable Living387Programmers797Arduino1932Data '+s+'141Server Fault1422Chess109Amateur Radio147Computational '+s+'917Home Improvement1599Worldbuilding1438Mi Yodeya197Christianity1185Community Building1956Aviation1701Poker1703Mathematics Educators1704SharePoint425Meta Stack Exchange171Code Review1964Game Development1967Homebrewing944User Experience1969Unix & Linux1715Board & Card Games1716Graphic Design969Tor696Economics955Drupal Answers1213Raspberry Pi958The Great Outdoors885Mathematics1731Emacs1989WordPress Development910Photography1736Space Exploration1993Cognitive '+s+'s1227Computer '+s+'1230Mathematica207Gardening & Landscaping2001Personal Productivity1235Super User1358Information Security727Theoretical Computer '+s+'1497Earth '+s+'220Russian'+l+'1914Role-playing Games1758Movies & TV479Anime & Manga67English'+l+' Learners228Web Applications485Robotics593The Workplace232Astronomy1519Personal Finance & Money808Stack Overflow in Japanese1266Seasoned Advice467Software Recommendations1012Sports332Stack Overflow in Portuguese761History763Ask Ubuntu1957Skeptics85TeX - LaTeX').group(1))

@MartinBüttner: .tobytes() gets the pixel data (16×16×4 = 1024), so it relies on the image. The file needs to be in RGBA though.

Ah, great. I thought it would return the actual byte stream of the file. As far as I'm aware the PNG images I uploaded don't have an alpha channel, though?

Oh looks like they do... I guess I messed that up.

Pillow? isn't it PIL?

@TheDoctor: Pillow is a PIL fork. PIL is unmaintained and doesn't work on Python 3.

C#, 2760 bytes
namespace System{class P{static void Main(){var c="us>g System;us>g System.Draw>g;class p{publ' stZ' void c(){var b=(Bitmap)Bitmap.FromFile(Console.ReadL>e());Console.Write(!1,1[3,3#2?!4,4#1?!5,5#2?!@#1?!+$SupK UsK*Salesforce%]^$< F't~_Fantasy%8,8#6?$Arqade*Ask Ubuntu%@#6?$WordPress Development%8,8#4?!9,9#2?$Phys's*UsK ExpKience%+$Travel*Craft CMS%5,5^!@#6?!]#1?$TeX - LaTeX%+$Mi Yodeya*Meta Stack Exchange%]#6?$ProgrammK|2,2#5?$Christianity*MZhemZ'a%@[]^$MZhemZ'|0,0#1?$Cross ValidZed*Theoret'al ComputK <%2,2^!]#5?$Seasoned Adv'e*Drupal AnswK|]^$Graph' Design*WebmastK|2,2^!4,4#5?!5,5#2?!@^$Ask PZents*Home Improvement%@#6?$Android Enthusiasts*Skept'|5,5#4?!@#5?$Web Appl'Z~s*English/_Usage%@#4?!]#8?$SharePo>t*B'ycle|]#1?$Electr'al Eng>eK>g*DZabase Adm>istrZor|4,4^!5,5#2?!+$Game Development*Photography%@:SKvK Fault%+$Geograph' InformZ~ Systems*Unix_L>ux%5,5^!0`Stack Apps*The Workplace%+!@[]#4?$InformZ~ Security*Ask DiffKent%]:Role-play>g Games*PKsonal F>ance_Money%3,9#8?$Academia%5,15^$& > Japanese%0,13:&*& > Portuguese%2,2:MZhOvKflow%3,3:AviZ~%4,4^$LEGO AnswK|5,5[@[][0,1:PokK*Anime_Manga%+$BlendK*H>duism%][8,8:WritK|0,1^!2`RaspbKry Pi*W>dows Phone%+$Biology*Worldbuild>g%9,9:Movies_TV%8,8[6`Trid~*Islam%0,1:Mus', Pract'e_Theory*L>guist'|][@[9,9:Ches|+!4,6:Garden>g_Landscap>g*Susta>able Liv>g%4,6:Buddhism*Startup|8,8:English/ LearnK|3,4[6,7:Network Eng>eK>g%9,5:Magento%+$Motor Veh'le Ma>tenance_Repair*MZhemZ's EducZor|4,8:GKman/%7`Joomla%7,6[+$QuantitZive F>ance*Ardu>o%9`Chemistry*Cryptography%8,8[0,1^!@[3`Tor%4,5:French/*The GreZ Outdoor|3`Project Management%3,6:Ch>ese/*Space ExplorZ~%+!2,6:Programm>g Puzzles_Code Golf%@:Cognitive <s*Signal Process>g%1,0:Ebook|@[4,5:Earth <*BeK%8,5:Emacs*ExpZriZe|1`History of < and MZh%3,4[@[+$Homebrew>g%3,6:DZa <*Video Product~%5,7:Russian/%9,4[4,8:Bibl'al HKmeneut's*Philosophy%11,6:Board_Card Games*Bitco>%3,5[@[3,8:AmZeur Radio%5,6:Genealogy_Family History%6,9:Software Quality Assurance_Test>g*Open DZa%3,6[11,7:Code Review%+$ComputK <*Community Build>g%10,6[+$Sports*Software RecommendZ~|9`Sound Design*ComputZ~al <%3,7:Japanese/%5,8[7,5:Puzzl>g%8,5:Econom's*Express~Eng>e AnswK|6,5[9,4[7`Freelanc>g*History%10,6:Italian/%6`Parent>g*Astronomy%6,7[9`RevKse Eng>eK>g*Robot'|10,8[+$Polit's*Pet|12,5:PKsonal Productivity*Phys'al Fitness$);}}";foreach(var s in "~ion;|s%;`,4:;&Stack OvKflow;_ & ;^#3?;]7,7;'ic;['!;Zat;Ker;@6,6;>in;<Science;:'$;/ Language;+0,0#3?;*$:$;'#7?;%$:!;$\";#).B%9<;!b.GetPixel(".Split(';'))c=c.Replace(s[0]+"",s.Substring(1));new Microsoft.CSharp.CSharpCodeProvider().CompileAssemblyFromSource(new CodeDom.Compiler.CompilerParameters("mscorlib.dll System.Core.dll System.Drawing.dll".Split()),c).CompiledAssembly.CreateInstance("p").GetType().GetMethod("c").Invoke(c,null);}}}

My solution doesn't use hashing, it actually examines the individual pixels of the image and decides based on that. I discovered that it was enough to examine the blue component of the image modulo 9. The idea is to repeatedly split based on the value of pixel.B%9, like so:
b.GetPixel(3,4).B % 9 < 7 ? "Russian Language" : (b.GetPixel(8,4).B % 9 < 6 ? "Project Management" : "Philosophy")

Using a script, I generated the following monstrous program (5197 bytes) that solves the problem using a binary decision tree:
using System;using System.Drawing;class p {public static void c(){var b=(Bitmap)Bitmap.FromFile(Console.ReadLine());Console.Write(b.GetPixel(4,5).B%9<6?b.GetPixel(1,1).B%9<5?b.GetPixel(1,10).B%9<1?b.GetPixel(3,4).B%9<1?b.GetPixel(2,8).B%9<2?b.GetPixel(0,0).B%9<3?b.GetPixel(3,10).B%9<8?"Super User":"Travel":b.GetPixel(0,2).B%9<3?"Salesforce":"Craft CMS":b.GetPixel(2,4).B%9<2?b.GetPixel(2,2).B%9<6?"Ask Ubuntu":"Ask Different":b.GetPixel(1,3).B%9<6?"Mathematics":"Programmers":b.GetPixel(2,7).B%9<3?b.GetPixel(2,4).B%9<1?b.GetPixel(2,8).B%9<2?"Database Administrators":"Christianity":b.GetPixel(0,1).B%9<3?"TeX - LaTeX":"Game Development":b.GetPixel(1,6).B%9<3?b.GetPixel(2,3).B%9<7?"English Language & Usage":"Skeptics":b.GetPixel(0,0).B%9<3?"StackApps":"Unix & Linux":b.GetPixel(0,6).B%9<1?b.GetPixel(1,4).B%9<2?b.GetPixel(1,5).B%9<3?b.GetPixel(0,4).B%9<1?"Arqade":"Mi Yodeya":b.GetPixel(1,6).B%9<6?"Drupal Answers":"User Experience":b.GetPixel(1,5).B%9<4?b.GetPixel(1,6).B%9<3?"SharePoint":"Bicycles":b.GetPixel(0,0).B%9<3?"Home Improvement":"Photography":b.GetPixel(0,0).B%9<3?b.GetPixel(0,7).B%9<2?b.GetPixel(0,1).B%9<1?"Science Fiction & Fantasy":"Theoretical Computer Science":b.GetPixel(0,4).B%9<2?"Android Enthusiasts":"Ask Patents":b.GetPixel(5,15).B%9<3?b.GetPixel(2,0).B%9<3?"Meta Stack Exchange":"Stack Overflow inJapanese":b.GetPixel(0,13).B%9<7?"Stack Overflow":"Stack Overflow in Portuguese":b.GetPixel(5,8).B%9<7?b.GetPixel(4,4).B%9<7?b.GetPixel(0,0).B%9<3?b.GetPixel(7,5).B%9<7?b.GetPixel(0,1).B%9<5?"German Language":"Server Fault":b.GetPixel(8,5).B%9<7?"Economics":"ExpressionEngine Answers":b.GetPixel(1,13).B%9<7?b.GetPixel(0,1).B%9<7?"Ebooks":"MathOverflow":b.GetPixel(7,5).B%9<7?"Buddhism":"Earth Science":b.GetPixel(6,6).B%9<7?b.GetPixel(4,6).B%9<7?b.GetPixel(3,6).B%9<7?"Poker":"Gardening & Landscaping":b.GetPixel(0,0).B%9<3?"Sustainable Living":"Startups":b.GetPixel(7,6).B%9<7?b.GetPixel(0,0).B%9<3?"Quantitative Finance":"Arduino":b.GetPixel(9,4).B%9<7?"Chemistry":"Cryptography":b.GetPixel(5,4).B%9<7?b.GetPixel(9,5).B%9<7?b.GetPixel(10,8).B%9<7?b.GetPixel(0,0).B%9<3?"Reverse Engineering":"Pets":b.GetPixel(12,5).B%9<7?"Personal Productivity":"Physical Fitness":b.GetPixel(6,7).B%9<7?b.GetPixel(3,4).B%9<7?"Tor":"Robotics":b.GetPixel(7,5).B%9<7?"Politics":"French Language":b.GetPixel(0,1).B%9<3?b.GetPixel(9,5).B%9<7?b.GetPixel(3,4).B%9<3?"LEGO Answers":"Magento":b.GetPixel(6,5).B%9<7?"Motor Vehicle Maintenance & Repair":"Network Engineering":b.GetPixel(2,6).B%9<7?b.GetPixel(0,0).B%9<7?"Programming Puzzles & Code Golf":"History of Science and Math":b.GetPixel(0,2).B%9<7?"Mathematics Educators":b.GetPixel(1,4).B%9<7?"Signal Processing":"Cognitive Sciences":b.GetPixel(3,6).B%9<7?b.GetPixel(4,6).B%9<5?b.GetPixel(5,8).B%9<5?b.GetPixel(6,5).B%9<7?b.GetPixel(9,8).B%9<7?b.GetPixel(1,1).B%9<7?"Geographic Information Systems":"Biblical Hermeneutics":b.GetPixel(11,6).B%9<7?"Board & Card Games":"Bitcoin":b.GetPixel(0,0).B%9<3?b.GetPixel(2,4).B%9<7?"RaspberryPi":"English Language Learners":b.GetPixel(8,5).B%9<7?"Emacs":"Expatriates":b.GetPixel(5,4).B%9<6?b.GetPixel(6,8).B%9<7?b.GetPixel(3,4).B%9<7?"Russian Language":"Amateur Radio":b.GetPixel(8,4).B%9<7?"Project Management":"Philosophy":b.GetPixel(0,7).B%9<7?b.GetPixel(1,1).B%9<7?"Cross Validated":"Homebrewing":b.GetPixel(0,1).B%9<7?"Web Applications":"Biology":b.GetPixel(3,4).B%9<7?b.GetPixel(0,2).B%9<3?b.GetPixel(1,7).B%9<6?b.GetPixel(1,6).B%9<6?"WordPress Development":"Electrical Engineering":b.GetPixel(1,1).B%9<7?"Physics":"Windows Phone":b.GetPixel(1,0).B%9<7?b.GetPixel(0,0).B%9<3?"Webmasters":"Academia":b.GetPixel(3,8).B%9<7?"Data Science":"Worldbuilding":b.GetPixel(6,6).B%9<7?b.GetPixel(5,6).B%9<7?b.GetPixel(0,1).B%9<7?"Genealogy & Family History":"Anime & Manga":b.GetPixel(6,9).B%9<7?"Software Quality Assurance & Testing":"Open Data":b.GetPixel(9,4).B%9<7?b.GetPixel(0,0).B%9<3?"Code Review":"Community Building":b.GetPixel(8,4).B%9<7?"Chinese Language":"Computer Science":b.GetPixel(5,6).B%9<6?b.GetPixel(4,4).B%9<7?b.GetPixel(9,8).B%9<7?b.GetPixel(10,6).B%9<7?b.GetPixel(0,0).B%9<3?"Sports":"Software Recommendations":b.GetPixel(1,1).B%9<7?"Information Security":"Sound Design":b.GetPixel(3,5).B%9<7?b.GetPixel(8,4).B%9<7?"Space Exploration":"Computational Science":b.GetPixel(0,0).B%9<3?"Tridion":"Puzzling":b.GetPixel(0,5).B%9<3?b.GetPixel(6,8).B%9<7?b.GetPixel(5,8).B%9<7?"Blender":"Writers":b.GetPixel(6,5).B%9<7?"Music, Practice & Theory":"Islam":b.GetPixel(0,1).B%9<3?b.GetPixel(0,4).B%9<7?"Mathematica":"The Workplace":b.GetPixel(0,0).B%9<3?"Linguistics":"Hinduism":b.GetPixel(6,4).B%9<5?b.GetPixel(9,8).B%9<7?b.GetPixel(3,7).B%9<7?b.GetPixel(0,0).B%9<3?"Japanese Language":"Aviation":b.GetPixel(7,6).B%9<7?"History":"Italian Language":b.GetPixel(9,4).B%9<7?b.GetPixel(5,3).B%9<7?"Chess":"Freelancing":b.GetPixel(0,0).B%9<3?"Parenting":"Beer":b.GetPixel(0,5).B%9<1?b.GetPixel(4,8).B%9<7?b.GetPixel(1,1).B%9<7?"Role-playing Games":"Movies & TV":b.GetPixel(6,8).B%9<7?"Astronomy":"The Great Outdoors":b.GetPixel(0,4).B%9<3?b.GetPixel(0,6).B%9<7?"SeasonedAdvice":"Personal Finance & Money":b.GetPixel(0,0).B%9<3?"Graphic Design":b.GetPixel(3,4).B%9<7?"Video Production":"Joomla");}}

Some people have used built-in compression functions in their solutions. I made my own, writing a script that identifies common substrings and replaces them by single-character shorthands. The code is compressed to the following 2502 bye string:
us@g System;us@g System.Draw@g;class p {publ| st^| void c(){var b=(Bitmap)Bitmap.FromFile(Console.ReadL@e());Console.Write(!4,5#6?!1,1#5?!1,10#1?!3`#1?!2,8#2?*!3,10#8?$Sup] Us]+Travel~0,2_$Salesforce+Craft CMS~2`#2?!2,2#6?$Ask Ubuntu+Ask Diff]ent~1,3#6?$M^hem^|s+Programm]s~2,7_!2`#1?!2,8#2?$D^abase Adm@istr^ors+Christianity~0,1_$TeX - LaTeX+Game Development~1,6_!2,3[English/:Usage+Skept|s'*$StackApps+Unix:L@ux~0,6#1?!1`#2?!1,5_!0`#1?$Arqade+Mi Yodeya~1,6#6?$Drupal Answ]s+Us] Exp]ience~1,5#4?!1,6_$SharePo@t+B|ycles'*$Home Improvement+Photography'*!0,7#2?!0,1#1?$> F|tion:Fantasy+Theoret|al Comput] >~0`#2?$Android Enthusiasts+Ask P^ents~5,15_!2,0_$Meta Stack Exchange+Stack Ov]flow @Japanese~0,13[Stack Ov]flow+Stack Ov]flow @ Portuguese~5,8<4`%*!7,5<0,1#5?$G]man/+S]v] Fault~8,5[Econom|s+ExpressionEng@e Answ]s~1,13<0,1[Ebooks+M^hOv]flow~7,5[Buddhism+Earth >~6,6<4,6<3,6[Pok]+Garden@g:Landscap@g'*$Susta@able Liv@g+Startups~7,6%*$Quantit^ive F@ance+Ardu@o~9`[Chemistry+Cryptography~5`<9,5<10,8%*$Rev]se Eng@e]@g+Pets~12,5[P]sonal Productivity+Phys|al Fitness~6,7<3`[Tor+Robot|s~7,5[Polit|s+French/~0,1_!9,5<3`_$LEGO Answ]s+Magento~6,5[Motor Veh|le Ma@tenance:Repair+Network Eng@e]@g~2,6<0,0[Programm@g Puzzles:Code Golf+History of > and M^h~0,2[M^hem^|s Educ^ors~1`[Signal Process@g+Cognitive >s~3,6<4,6#5?!5,8#5?!6,5<9,8<1,1[Geograph| Inform^ion Systems+Bibl|al H]meneut|s~11,6[Board:Card Games+Bitco@'*!2`[Raspb]ryPi+English/ Learn]s~8,5[Emacs+Exp^ri^es~5`#6?!6,8<3`[Russian/+Am^eur Radio~8`[Project Management+Philosophy~0,7<1,1[Cross Valid^ed+Homebrew@g~0,1[Web Appl|^ions+Biology~3`<0,2_!1,7#6?!1,6#6?$WordPress Development+Electr|al Eng@e]@g~1,1[Phys|s+W@dows Phone~1,0%*$Webmast]s+Academia~3,8[D^a >+Worldbuild@g~6,6<5,6<0,1[Genealogy:Family History+Anime:Manga~6,9[Software Quality Assurance:Test@g+Open D^a~9`%*$Code Review+Community Build@g~8`[Ch@ese/+Comput] >~5,6#6?!4`<9,8<10,6%*$Sports+Software Recommend^ions~1,1[Inform^ion Security+Sound Design~3,5<8`[Space Explor^ion+Comput^ional >'*$Tridion+Puzzl@g~0,5_!6,8<5,8[Blend]+Writ]s~6,5[Mus|, Pract|e:Theory+Islam~0,1_!0`[M^hem^|a+The Workplace'*$L@guist|s+H@duism~6`#5?!9,8<3,7%*$Japanese/+Avi^ion~7,6[History+Italian/~9`<5,3[Chess+Freelanc@g'*$Parent@g+Be]~0,5#1?!4,8<1,1[Role-play@g Games+Movies:TV~6,8[Astronomy+The Gre^ Outdoors~0`_!0,6[SeasonedAdv|e+P]sonal F@ance:Money'*$Graph| Design~3`[Video Production+Joomla$);}}

The dictionary needed for decompression is just 108 bytes:
: & ;<%!;|ic;`,4;_#3?;^at;]er;[%$;@in;>Science;~'!;/Language;+'$;*!0,0#3?;'$:;%#7?;$\";#).B%9<;!b.GetPixel(

The dictionary uses semicolons as delimiter, and contains single characters followed by their decompression. So to decompress, ":" would first be replaced by " & ", then "<" by "%!", "|" by "ic", and so on. Decompression of a string c can be expressed in quite a concise way:
foreach (var s in "[dictionary]".Split(';')) c = c.Replace(s[0] + "", s.Substring(1));

Then, after decompression I use some reflection black-magic to compile the code on the fly and run it:
namespace System
{
    using Collections.Generic;
    using CodeDom.Compiler;
    using Microsoft.CSharp;
    using Linq;
    using Reflection;
    class P
    {
        static void Main()
        {
            var c = "us@g System;us@g System.Draw@g;class p {publ| st^| void c(){var b=(Bitmap)Bitmap.FromFile(Console.ReadL@e());Console.Write(!4,5#6?!1,1#5?!1,10#1?!3`#1?!2,8#2?*!3,10#8?$Sup] Us]+Travel~0,2_$Salesforce+Craft CMS~2`#2?!2,2#6?$Ask Ubuntu+Ask Diff]ent~1,3#6?$M^hem^|s+Programm]s~2,7_!2`#1?!2,8#2?$D^abase Adm@istr^ors+Christianity~0,1_$TeX - LaTeX+Game Development~1,6_!2,3[English/:Usage+Skept|s'*$StackApps+Unix:L@ux~0,6#1?!1`#2?!1,5_!0`#1?$Arqade+Mi Yodeya~1,6#6?$Drupal Answ]s+Us] Exp]ience~1,5#4?!1,6_$SharePo@t+B|ycles'*$Home Improvement+Photography'*!0,7#2?!0,1#1?$> F|tion:Fantasy+Theoret|al Comput] >~0`#2?$Android Enthusiasts+Ask P^ents~5,15_!2,0_$Meta Stack Exchange+Stack Ov]flow @Japanese~0,13[Stack Ov]flow+Stack Ov]flow @ Portuguese~5,8<4`%*!7,5<0,1#5?$G]man/+S]v] Fault~8,5[Econom|s+ExpressionEng@e Answ]s~1,13<0,1[Ebooks+M^hOv]flow~7,5[Buddhism+Earth >~6,6<4,6<3,6[Pok]+Garden@g:Landscap@g'*$Susta@able Liv@g+Startups~7,6%*$Quantit^ive F@ance+Ardu@o~9`[Chemistry+Cryptography~5`<9,5<10,8%*$Rev]se Eng@e]@g+Pets~12,5[P]sonal Productivity+Phys|al Fitness~6,7<3`[Tor+Robot|s~7,5[Polit|s+French/~0,1_!9,5<3`_$LEGO Answ]s+Magento~6,5[Motor Veh|le Ma@tenance:Repair+Network Eng@e]@g~2,6<0,0[Programm@g Puzzles:Code Golf+History of > and M^h~0,2[M^hem^|s Educ^ors~1`[Signal Process@g+Cognitive >s~3,6<4,6#5?!5,8#5?!6,5<9,8<1,1[Geograph| Inform^ion Systems+Bibl|al H]meneut|s~11,6[Board:Card Games+Bitco@'*!2`[Raspb]ryPi+English/ Learn]s~8,5[Emacs+Exp^ri^es~5`#6?!6,8<3`[Russian/+Am^eur Radio~8`[Project Management+Philosophy~0,7<1,1[Cross Valid^ed+Homebrew@g~0,1[Web Appl|^ions+Biology~3`<0,2_!1,7#6?!1,6#6?$WordPress Development+Electr|al Eng@e]@g~1,1[Phys|s+W@dows Phone~1,0%*$Webmast]s+Academia~3,8[D^a >+Worldbuild@g~6,6<5,6<0,1[Genealogy:Family History+Anime:Manga~6,9[Software Quality Assurance:Test@g+Open D^a~9`%*$Code Review+Community Build@g~8`[Ch@ese/+Comput] >~5,6#6?!4`<9,8<10,6%*$Sports+Software Recommend^ions~1,1[Inform^ion Security+Sound Design~3,5<8`[Space Explor^ion+Comput^ional >'*$Tridion+Puzzl@g~0,5_!6,8<5,8[Blend]+Writ]s~6,5[Mus|, Pract|e:Theory+Islam~0,1_!0`[M^hem^|a+The Workplace'*$L@guist|s+H@duism~6`#5?!9,8<3,7%*$Japanese/+Avi^ion~7,6[History+Italian/~9`<5,3[Chess+Freelanc@g'*$Parent@g+Be]~0,5#1?!4,8<1,1[Role-play@g Games+Movies:TV~6,8[Astronomy+The Gre^ Outdoors~0`_!0,6[SeasonedAdv|e+P]sonal F@ance:Money'*$Graph| Design~3`[Video Production+Joomla$);}}";
            foreach (var s in ": & ;<%!;|ic;`,4;_#3?;^at;]er;[%$;@in;>Science;~'!;/ Language;+'$;*!0,0#3?;'$:;%#7?;$\";#).B%9<;!b.GetPixel(".Split(';')) c = c.Replace(s[0] + "", s.Substring(1));

            var o = new CSharpCodeProvider().CompileAssemblyFromSource(new CompilerParameters("mscorlib.dll System.Core.dll System.Drawing.dll".Split()), c).CompiledAssembly.CreateInstance("p").GetType().GetMethod("c");
            o.Invoke(o, null);
        }
    }
}

Note that the examples used here for explanation are slightly different from the one used in the 2876 byte solution.

I've edited your post into our usual format, I hope you don't mind! :)

Alright, thank you very much.

I think, you can remove namespace to save some bytes.

Mildly interesting: http://i.imgur.com/MNnndMd.png - picture showing which pixels (highlighted in red) in each icon are used to identify it in my program.

@TomvanderZanden Looking at that, shouldn't you be able to shorten your code considerably by recognising all the non-beta sites by a single pixel or two?

@MartinBüttner No, that wouldn't make a difference. The non-beta sites are recognized by a pixel or two, but those pixels are only examined after recognizing a bunch of other sites first. Changing the order of comparisons wouldn't affect the code length. The code uses a total of 129 comparisons which optimal given that there are 130 images.

@TomvanderZanden Ah I see, never mind then. :)

Good lord. The world needs more people like you.

This was my first thought for this (the pixel-based identification) but I wasn't crazy enough to actually try it. Good for you.

"Using a script": would you mind posting your script too? This is a great answer, btw.

Node.js, 3178 3130 2667 2608 Bytes
Computes the SHA1 hash of each file's image data and using bytes 16 through 19 of the hex digest, indexes the site names.
Using bytes 12 through 16 of the hex digest of each file's SHA1 hash, indexes the site names. There may be a shorter combination using only 3 bytes of the hex digest.
function $(e){r=require;r("pngparse").parseFile(e,function(e,t){console.log("Academia;Android Enthusiasts;Anime & Manga;Ask Different;Arduino;Ask Ubuntu;Astronomy;Aviation;Video Production;Beer;Bicycles;Biology;Bitcoin;Blender;Board & Card Games;Stack Overflow in Portuguese;LEGO Answers;Buddhism;Chemistry;Chess;Chinese Language;Christianity;Programming Puzzles & Code Golf;Code Review;Cognitive Sciences;Community Building;Seasoned Advice;Craft CMS;Cryptography;Computer Science;Theoretical Computer Science;Data Science;Database Administrators;Home Improvement;Drupal Answers;Signal Processing;Earth Science;Ebooks;Economics;Electrical Engineering;English Language Learners;Emacs;English Language & Usage;Expatriates;ExpressionEngine Answers;Physical Fitness;Freelancing;French Language;Game Development;Arqade;Gardening & Landscaping;Genealogy & Family History;German Language;Geographic Information Systems;Graphic Design;Amateur Radio;Biblical Hermeneutics;Hinduism;History;Homebrewing;History of Science and Math;Islam;Italian Language;Stack Overflow in Japanese;Japanese Language;Joomla;Mi Yodeya;Linguistics;Magento;Martial Arts;Mathematics;Mathematics Educators;Mathematica;MathOverflow;Motor Vehicle Maintenance & Repair;Meta Stack Exchange;Personal Finance & Money;Movies & TV;Music, Practice & Theory;Network Engineering;Open Data;The Great Outdoors;Parenting;Ask Patents;Pets;Philosophy;Photography;Physics;Project Management;Poker;Politics;Personal Productivity;Programmers;Puzzling;Quantitative Finance;Raspberry Pi;Reverse Engineering;Robotics;Role-playing Games;Russian Language;Salesforce;Computational Science;Science Fiction & Fantasy;Information Security;Server Fault;SharePoint;Skeptics;Software Recommendations;Sound Design;Space Exploration;Spanish Language;Sports;Software Quality Assurance & Testing;Stack Apps;Stack Overflow;Startups;Cross Validated;Super User;Sustainable Living;TeX - LaTeX;Tor;Travel;Tridion;Unix & Linux;User Experience;Web Applications;Webmasters;Windows Phone;WordPress Development;The Workplace;Worldbuilding;Writers".split(";")[x=r("crypto").createHash("sha1").update(t.data).digest("hex").slice(16,20),x=="c7da"?27:"f38c4a899f50c7d09a0f9dde6e05bbaebb274fc59f1ba9c4b8c315490f3d887b55f27c526f6f79c7db63f12feccafebf80fde98b13f6f6dbb8e59d6b97a09fe8cb0101f6abc8c963004f2f1aafbe216457ef8210ea104d841381d529cdd2697cf809f3d5cb0f1d91d970a981c41fe617d62c01284afdbbf78588490de40a56a0c7e613480354d13a738a84fc0bf2433d2351d585039c9795f8167997d15c1b2c8144ca40223794e66864608e305d5271faddc88177ef9d44bbd4c752b9d938ec92af827550fb".match(/.{3}/g).indexOf(x.slice(0,3))])})}

The word “Language” is used 9 times. You could use a variable for it.

Didn't observe the site names. Thanks.

You can reduce your table's size by 446 bytes. Switch to a CSV format: h="17352368".match(/.{4}/g) (the 4 character hashes, split into an array), s="MathOverflow;StackOverflow in Portuguese".split(";") (names separated by a ;) and then put it all together again: t={}h.forEach(function(k,i){t[k]=s[i]}) (results in the same object as your code). There are 132 semicolons, so even if you switch to a 2-byte character (OP says there should be no unicode in the site names), you'll save space. Also, you can add @manatwork 's optimisation on top of that additional saving.

You can shorten it further by sparing the split()s: us a single string like "1234Site;5678Other". Then, supposing there will be no clash between hash fragments and site names, a single match() will do it: function $(e){r=require;return"8d4fAcademia;3a6dAndroid Enthusiasts;5caeAnime & Manga;804cAsk Different;bef3Arduino".match(r("crypto").createHash("sha1").update(r("fs").readFileSync(e)).digest("hex").slice(12,16)+"([^;]+)")[1]}

@MartinBüttner, the initial post did not mention that file hashing isn't allowed. I was hashing the file but have now updated my post to hash the image's data instead.

Why inline the site names? Better download them via http from stackexchange :) That will cut down your source sice massivly

Python 2.7, 1906 1889 bytes
This solution uses CRC32 on the pixel data to make a unique 2 digit base 95 identifier. The index of the identifier is then used to look up the answer string.
The tricky bit was finding a combination of hash-style functions that would result in 132 (or 131) small but unique labels. I tried a few options before settling on this one. It seems quite compact.
The program uses Python PIL to read the pixel data from the file.
import sys,re,zlib as Z,base64 as B,PIL.Image as P
g=lambda p:chr(32+Z.crc32(p)%95)
D=P.open(sys.argv[1]).tostring()
print Z.decompress(B.b64decode('eJxlVc164zYMvPMpeMqp+xDexHGyX9yocX7aIyzBFmuKUPljR/v0HdCxE+9eLBiEwAEwGM1a6nhwZGahi+I6Ow+5L8lRygk+N7C9sksKW0Sknb1xmw1HDtnMYldckOp9WZeQC8wcJcgwmdneUXYSzKvrWGwTpSttdXxnjua7a6fWc4IhXrYTnrkVh1PPodMAodjh4mt9LGhA6CpTu7OPe44bLwfrgm0k5rItnNg8zBePdhbSgSOSlq7rXRrMdY/KgGlSKyX8uoBo+4ByCm0ZjohzR8HlyQDkNtIwuLC1Tfn5E/gUgXRsF+I3plpPvHd8gL3FO27PdtU6Di3wXcswFE1kvxfnO2QxK6YkgTs76/auxXWRNtleL1ewpjHrdWM/6ZtjyRxPucxzzxI5u5a8/e3whjJd/FkTSpp1wK21Uha04E4wt/thjLLnQad1E8uIbKcWrdw24C9KBvSkWOcUc3/OO1+L7JKZtzpO18Ly3OZYEc3DFm3kWN8KW+9Sf+6ofWCKQW+YD6Sv/Xp+ZV+Sdn7+PhLyUUbnYEdFIeGY+oyy6adUr7x1OegAbyOzp9Dq1bBD+5nZKEvsDe/ZyzgcCfofqA1/7DjoUK80uEstjfr+ggOTkg/+Wxqcn+wdGihgy4LjQOFLaj6OyrX2PmwEh0plu5pS5iGZxcfZDSe01cxwzCXaJ+qcgNlrX2u4Q1JcWbK2884FbA8oerpSB7aOfFBkHz4rm9M8LHBjCXNv7pOnwdxn8u4rwt+X4weNpGQ3J+Mz+IfI4Mksnf0HlJ7IPODWoosAZEtEhCx4RiwGGBOzOjNWiT4CzradY6uPhPv0UrVPUMxScG5fGQ3yjBpcyBxIa7rCMo3kolmyMrpWMH9ve8Bk02D+EuroT9FLrNKEfFhAXcznV7OETrV/gMUEbakxdXMm8yfng8TdBVUfRw5W90XXyy4iU7aPJXei8BtSTdMwlbMGAwwou2H96Z2XJLqoTS/npT1yM6lq/IvVUIlE5yrxGtlBwhrxrjbsXMpJBfdf1abyXNVGL/+rEFBkqsryUbl5ojSuOYIQjTPQH7zBF5U9yVrqTU/i+dvoaVK2H1XzqWCxLphC0DVwWOWoSkvlMtCdVv9EuVtXBbtuR8iUJnPBfW5L1DpWHIEIMcVns+rRxwZCDnPHYwW1kk0+wI1pt5BI6HvNoAcFrP5YmtVIuBNK4CUevxzwhK/SAYcoF8/50CyvcjtLqcQPjjxzqlM8smk2jr9+N/QvvhrwX0dJyb4iBwBxZ1ZlRB0vCaNblZRBVFqDsQ8YFxI+89/2G7DgaZ4lmudIUBo8XKdgX4J7V31xobwbzaGlYDq1o2+8VigqA8fK4RjwfdXRv0EI5JAsqBUQKbFrVAsvhEz5ipMdJtvWGN+tT5+YNwxB8/wPEZPMIw==')).split('\n')[re.findall('..','''<3 JlXAa}J>33:7XotUSZDHC }=c4G]wdaIwhi)Xa(h6B"jdfcQ_0^\wLo{Iyn7;XaRco&w7Ht(/]v^$u~?0:r,!?*y``7>5j%\SAq`G{v@&'#LuZn7)['#JTY d4(6mR%ljnE@/s6s6A-[&-\kR*[C$3*qgY25!vy&~>0H<TEGV.N$K_y|m5O#)nkhwg=E+CYmW<c /BQgFHgujMCm`793uA)T.&'f$vFRh zXin[3q:y\CGH.!hAw=k5v!gCd4g0]mU/'O''').index(g(D)+g(D*3))]

Python 2.7 2150 bytes
This is a version without using compression or encoding libraries. The Stack Exchange List is compressed with a simple exchange method. The characters that are not used in the text:
`~!@#$%^*()_+=[]{}:;"<>?/0123456789

are used to hold common string segments. The text is uncompressed with the for k,v in [(v[0],v[1:]) for v in K.split('|')]:T=T.replace(k,v) line. The two character indexing table is the same as in the above program.
import sys,re,zlib as Z,PIL.Image as P
g=lambda p:chr(32+Z.crc32(p)%95)
D=P.open(sys.argv[1]).tostring()
K='~ Engineer?|%]ematic|^*{|)Computer @|[ Develop3|" Answ7|! Language|@Science|#Software|$ Design|*Stack |(Japanese|_History|+Programm|=English|` & |<tion|>raph|?ing|/Ask |]Math|{Overflow|}tics|:logy|;ian|0Data|1Game|2ance|3ment|4Home|5ard|6ity|7ers|8Exp|9The'
T='Academia|Android Enthusiasts|Anime`Manga|/Different|Arduino|/Ubuntu|Astronomy|Avia<|Video Produc<|Beer|Bicycles|Bio:|Bitcoin|Blender|Bo5`C5 1s|^ in Portuguese|LEGO"|Buddhism|Chemistry|Chess|Chinese!|Christ;6|+? Puzzles`Code Golf|Code Review|Cognitive @s|Commun6 Build?|Seasoned Advice|Craft CMS|Cryptog>y|)|9oretical )|0 @|0base Administrators|4 Improve3|Drupal"|Signal Process?|Earth @|Ebooks|Economics|Electrical~|=! Learn7|Emacs|=!`Usage|8atriates|8ressionEngine"|Physical Fitness|Freelanc?|French!|1[|Arqade|G5en?`Landscap?|Genea:`Family _|German!|Geog>ic Informa< Systems|G>ic$|Amateur Radio|Biblical Hermeneu}|Hinduism|_|4brew?|_ of @ and ]|Islam|Ital;!|^ in (|(!|Joomla|Mi Yodeya|L?uis}|Magento|Martial Arts|%s|%s Educators|%a|]{|Motor Vehicle Mainten2`Repair|Meta *Exchange|P7onal Fin2`Money|Movies`TV|Music, Practice`9ory|Network~|Open 0|9 Great Outdoors|Parent?|/Patents|Pets|Philosophy|Photog>y|Physics|Project Manage3|Poker|Poli}|P7onal Productiv6|+7|Puzzl?|Quantitative Fin2|Raspberry Pi|Rev7e~|Robo}|Role-play? 1s|Russ;!|Salesforce|Computa<al @|@ Fic<`Fantasy|Informa< Secur6|Server Fault|SharePoint|Skep}|# Recommenda<s|Sound$|Space 8lora<|Spanish!|Sports|# Qual6 Assur2`Test?|*Apps|^|Startups|Cross Validated|Super User|Sustainable Liv?|TeX - LaTeX|Tor|Travel|Tridion|Unix`Linux|User 8erience|Web Applica<s|Webmast7|Windows Phone|WordPress[|9 Workplace|Worldbuild?|Writ7|'
for k,v in [(v[0],v[1:]) for v in K.split('|')]:T=T.replace(k,v)
print T.split('|')[re.findall('..','''<3 JlXAa}J>33:7XotUSZDHC }=c4G]wdaIwhi)Xa(h6B"jdfcQ_0^\wLo{Iyn7;XaRco&w7Ht(/]v^$u~?0:r,!?*y``7>5j%\SAq`G{v@&'#LuZn7)['#JTY d4(6mR%ljnE@/s6s6A-[&-\kR*[C$3*qgY25!vy&~>0H<TEGV.N$K_y|m5O#)nkhwg=E+CYmW<c /BQgFHgujMCm`793uA)T.&'f$vFRh zXin[3q:y\CGH.!hAw=k5v!gCd4g0]mU/'O''').index(g(D)+g(D*3))]

C#, 2672 bytes
using System.IO;using System.IO.Compression;using System.Security.Cryptography;using System.Text;namespace l
{internal class Program
{private static void Main(string[]args)
{string m="H4sIAAAAAAAEAGVWy3bbNhT8Fayyas8hxTd2IAk66bEa1XKSdgmRsISaBFgAtKN8fQeU5dgnKxHAxcV9zMxVmXasF4OclKBpkzE9 WKMGwrU/LU4J5x1t8phpNUnygWyFPgrKupS5R9KqhwdppfY0iltmh0VpQ+OyDWdfDov2C43h3XlrtJnONOo69qSEV0bTbBN/VYM0 ZGfNsPSXPdbVUloaNUWt+nM/SkfLNK+VGc3xTOu2qpXvjdK02hT1KPUA46ZsaiPsgOCa8HMjJlyra7b3on8kn5+kfRjNM1Ga7Iz1 y3GRTtIky275zWfCtHuW1tEs6eplGE7KTbSo4+aEeiDuM23jBgvnaJSXzUlpXCa3KMIijhJJ4NDCUAmt/JkmmxjpHK2YJqWPZLf8 +IEcQmRmkOTGjA+0ZZt1cSeflHymXVk35ojL6kmSfa+k7hF9lWSNmaYlOCX1osYB7mgeJXspnNFyIGx4Ur2kXdE0Vjx40mz3cB01 9jz7EMB8OlO4hpd58dJeXdO8iu5P0ljpVS9G8st5G8et8OJ1nURFWB8E0mYDsgpVEd6gZG1efTQAxadptuZJTgEHLE5au8zwfC1s xLO9OmrsoDLIzYVMSs65sP70+kxVb/jBmEdHGWO8D3BRPboSx3yUvbdrsFwfUX9pg4d0w7AclTu9doPcSmF1eJNXJZ8E7hdZ9ovV B/LFhd6lPOffZwHfwgectRxLGwI0+vLSaw5dl+xOZ7cG0SmvAxx4XXdWylHoPsSTtQWWuv/5EIAZByySVj7J0cxrfaKyZvY/sI12 PLoBXKUOQPkQbg2uF3PwFSfljdRSBNDjqBOTGs/kIypvAEjO+I20k9A/X0pKbF26rnryST8YnAdGkf3ZeTmhC5vo5uW4lQ79oG3X MBjJxZI7MShDU1bW6jCuSX7EA4hg8aEJRcc+Kg1ygxoo2jWOKstC+w9WPq8NafjLCTEP174SZAXJ8KeQ+Cc3iolGrPzkxajexl9v 4l/J+oeYRWAb5WV7/X5zJU/+MGYaoVlRtFXkH3DqLGjeFbeIZgmU7INw1VtYa28unxZEBTQtNC2L8hCYDIWCZVpUb5aEQ5IuKM9Y /PNA0Kwsw/IaKM052xoYkq8SxR0lslXaSy1C9h/A8lkoi8eSrQysWrPk3/sT8kDfWLMDvoxecXW9swXBoZVVszWQiKAe919Bo24L Oe5/A40E1HK1XJl8pqzc/Cn9s7GP7yjS8fjzLDUJ/KUNq2BNbqwUnnxe/GBCclXNdyIIeLBP8iwI9w6g0ChQ3eU7GQpVxbuTGo0z QVMYr3Yn8yoxLIovzIBdmoHh/4KtYUig6ivgNyXfmUfINE/znRnVS7Hj17yv8v8U9LPM2qt+Bt61cbZK6Cp+dffXIhCpF6tWvtSL Vml2J9x8kBbI2yla5DWkFbflu2LEXXZnDmZ9PmniO4NW/U7mUZwD/15mRlHcLeD/W2jmbbwX0HBQalXH5KKYK7sQ/VW/eFxdId+p dZitxNVeuDC32neclP1iQ7Y17/bSIlZYLqOnaZrvT2jHDhPO06qr9o9yXiOuKr43D/4Zh4BUj9GA2bd6Q5Gidm8W8OyF2AXL97NA IJCz0djLtG0ajk39Vggp26T72QQucJ6+ukeRxzB1mHOLfUHkvXQrQuq4vSCYzTMeTpL3rKVdyrGDGYvTkrPGGufIV/hDrHKgeVLv lxnpfnEAxCZL94vzoIs4oBm3QMCqffxe/o3W3Ar8QpWre2MhVu29FZBRWhTFvVVDyKmrmi9afQ/iqfTyPSAhOA55o+drWzLefpOH EG7QtUu92CbG3oQ/NuuoaJtvEDfz7AhwrcNIz74ZO+zCJHgn3W2dBAbh8BGwgfMy5liMw+E6n7Ok+obGwu3/ajKqV1QJAAA=";string f=BitConverter.ToString(new SHA1Managed().ComputeHash(File.OpenRead(Console.ReadLine()))).Replace("-","").Substring(0,3);foreach(string n in d(m).Split(':'))
{if(f==n.Substring(0,3))
{Console.WriteLine(n.Substring(3,n.Length-3));break;}}}
public static String d(String c)
{byte[]d=Convert.FromBase64String(c);using(MemoryStream i=new MemoryStream(d))
using(GZipStream z=new GZipStream(i,CompressionMode.Decompress))
using(MemoryStream o=new MemoryStream())
{z.CopyTo(o);StringBuilder sb=new StringBuilder();return Encoding.UTF8.GetString(o.ToArray());}}}}

The table (string) of labels and partial SHA hashes is compressed to save a few bytes. The original dictionary looks like:
84FAcademia:4C5Android Enthusiasts:C61Anime & Manga:AF4Ask Different:01DArduino:18DAsk Ubuntu:14FAstronomy:0FFAviation:521Video Production:5AFBeer:0C7Bicycles:846Biology:BD9Bitcoin:927Blender:C8CBoard & Card Games:BBAStack Overflow in Portuguese:355LEGO Answers:53FBuddhism:7B1Chemistry:D1CChess:068Chinese Language:52CChristianity:321Programming Puzzles & Code Golf:DA2Code Review:F8BCognitive Sciences:935Community Building:603Seasoned Advice:F7CCraft CMS:DA0Cryptography:8BCComputer Science:690Theoretical Computer Science:D11Data Science:307Database Administrators:D69Home Improvement:A13Drupal Answers:0E5Signal Processing:8EEEarth Science:9B2Ebooks:AAAEconomics:511Electrical Engineering:42AEnglish Language Learners:E98Emacs:755English Language & Usage:4E6Expatriates:8DEExpressionEngine Answers:FF3Physical Fitness:EBBFreelancing:5D7French Language:C81Game Development:08BArqade:FE0Gardening & Landscaping:138Genealogy & Family History:EAEGerman Language:38EGeographic Information Systems:020Graphic Design:DFCAmateur Radio:4A8Biblical Hermeneutics:7FAHinduism:4E6History:955Homebrewing:4CEHistory of Science and Math:08BIslam:0A8Italian Language:B21Stack Overflow in Japanese:E8DJapanese Language:B63Joomla:400Mi Yodeya:6F7Linguistics:C6BMagento:C6BMartial Arts:506Mathematics:479Mathematics Educators:5A1Mathematica:588MathOverflow:6EAMotor Vehicle Maintenance & Repair:503Meta Stack Exchange:3ACPersonal Finance & Money:09CMovies & TV:0EFMusic, Practice & Theory:A82Network Engineering:FE1Open Data:CA9The Great Outdoors:9BEParenting:365Ask Patents:BF6Pets:591Philosophy:AE9Photography:A01Physics:545Project Management:28EPoker:E46Politics:471Personal Productivity:85DProgrammers:D15Puzzling:6BFQuantitative Finance:945Raspberry Pi:76BReverse Engineering:1F5Robotics:3C1Role - playing Games:B77Russian Language:6D1Salesforce:D13Computational Science:E19Science Fiction & Fantasy:BDDInformation Security:BEFServer Fault:446SharePoint:9F9Skeptics:99ESoftware Recommendations:D0DSound Design:7A6Space Exploration:CCESpanish Language:A24Sports:EE4Software Quality Assurance & Testing:B1DStack Apps:D33Stack Overflow:F4EStartups:8EACross Validated:63BSuper User:254Sustainable Living:13ETeX - LaTeX:8D9Tor:DFDTravel:777Tridion:F9CUnix & Linux:945User Experience:5EDWeb Applications:A21Webmasters:EDCWindows Phone:525WordPress Development:DB3The Workplace:81EWorldbuilding:539Writers

It looks like you're taking the hash of the file not of the actual image data. So if I added some meta-data to the file without altering the image, wouldn't that break your code?

var should safe a couple of bytes. 2) What's with the stringbuilder? I don't see it used. 3) StreamReader.ReadToEnd might help a bit as well.


text:
Find a point's position on the integral Hilbert curve
The Hilbert curves are a class of space-filling fractal curves where every bend in the path is at a right angle and the curve as a whole fills up a square, with the property that sequences of consecutive segments are always displayed as contiguous blocks.
Traditionally, the curve is drawn as a series of very squiggly lines inside a square such that each segment becomes smaller and smaller until they fill up the whole square. However, like the Walsh matrix, it is also possible to represent the limit curve as a sequence of line segments connecting lattice points that grows infinitely until it fills up an entire quadrant of lattice points on the Cartesian plane.
Suppose we define such a curve as the integral Hilbert curve, as follows:

Start at the origin.
Move one unit right (R), one unit up (U), and one unit left (L). Down will be notated as D.
Let RUL be H_1. Then define H_2 as H_1 U I_1 R I_1 D J_1 where:

I_1 is H_1 rotated 90 degrees counterclockwise and flipped horizontally.
J_1 is H_1 rotated 180 degrees.

Perform the steps of H_2 after H_1 to complete H_2.
Define H_3 as H_2 R I_2 U I_2 L J_2, where:

I_2 is H_2 rotated 90 degrees clockwise and flipped vertically.
J_2 is H_2 rotated 180 degrees.

Perform the steps of H_3 after H_2 to complete H_3.
Define H_4 and other H_n for even n the same way as H_2, but relative to H_{n-1}.
Define H_5 and other H_n for odd n the same way as H_3, but relative to H_{n-1}.
The integral Hilbert curve is H_infinity.

We get a function f(n) = (a, b) in this way, where (a, b) is the position of a point moving n units along the integral Hilbert curve starting from the origin. You may notice that if we draw this curve 2^{2n}-1 units long we get the nth iteration of the unit-square Hilbert curve magnified 2^n times.
Your task is to implement f(n). The shortest code to do so in any language wins.

Example inputs and outputs:
> 0
(0, 0)
> 1
(1, 0)
> 9
(2, 3)
> 17
(4, 1)
> 27
(6, 3)
> 41
(7, 6)
> 228
(9, 3)
> 325
(24, 3)

Note that your solution's algorithm must work in general; if you choose to implement your algorithm in a language where integers are of bounded size, that bound must not be a factor in your program's code.

By your last line, do you mean that if we are implementing the iterative approach of the algorithm, we should not have while (s<INT_MAX) in the loop ?

No, I mean your code shouldn't have a top-down approach that assumes a maximum size. If you need an INT_MAX checker for stability, you can assume that you will never receive input that would trigger that case.

GolfScript (62 bytes)
{1:a:b(.@4base{:?3%!:|b^?2<3?=.b^:b^^|!.a^:a^{\}*{@2*@+}2*}/\}

This is an anonymous function which takes n on the stack and leaves x y on the stack. Online demo
It's essentially the iterative code from the Wikipedia article reversed so that it processes the base-4 representation of n from most-significant to least-significant digit instead of least-significant to most-significant. This simplifies the bookkeeping required to output x and y in the right order.
Pseudocode translation (not tested, may contain errors):
a = b = true;
x = y = 0;
foreach (digit in n base 4) {
    p = (digit % 3 == 0) ^ b;
    q = (digit < 2) ^ b;
    b ^= (digit == 3);
    if (a) swap(p, q);
    a ^= (digit % 3 != 0);
    y = 2*y + (p ? 1 : 0);
    x = 2*x + (q ? 1 : 0);
    swap(x, y);
}
swap(x, y)

R: 178 169
Room for improvement in this, but it's a start
f=function(d){x=y=0;s=1;while(s<Inf){a=bitwAnd(1,d/2);b=bitwAnd(1,bitwXor(d,a));if(b==0){if(a==1){x=s-1-x;y=s-1-y};t=x;x=y;y=t};x=x+(s*a);y=y+(s*b);d=d/4;s=s*2};c(x,y)}

Test Run
> f(0)
[1] 0 0
> f(1)
[1] 1 0
> f(9)
[1] 2 3
> f(41)
[1] 7 6
> f(325)
[1] 24  3

source: Stack Exchange

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

sort: votes


text:
Significant Whitespace
We define whitespace to be any of the three characters, tab (0x09), newline (0x0A) or space (0x20).
For this challenge, you're to write two programs or functions in the same programming language, which perform the following tasks:

Count the whitespace characters in a given string. For instance, the input
  123 -_-   abc
def

would return 7 (provided there is no trailing newline).
Split a given string at consecutive runs of whitespace. If the string starts or ends with whitespace, no empty strings should be returned at the ends. For instance, the same input
  123 -_-   abc
def

would return ["123", "-_-", "abc", "def"].

In either case you may take input via STDIN, command-line argument or function argument a return the result or print it STDOUT. For the second program, if you choose to print to STDOUT, please print each string on its own line, without surrounding quotes.
For both programs you may assume that the input contains only printable ASCII (0x20 to 0x7E) and whitespace.
Now here is the catch:

If all whitespace is removed from both programs/functions, the resulting strings have to be identical. That is, your two submissions may only differ in the number and placement of whitespace characters.
Neither program/function may contain any string or regex literals (character literals are fine, provided your language has a designated character type).
Neither program/function may contain any comments.
You must not read the program's source code, directly or indirectly.

This is code golf. Your score is the sum of the sizes of both solutions (in bytes). Lowest score wins.
Leaderboards
The following Stack Snippet generates both a regular leaderboard and an overview of winners by language. So even if your language of choice doesn't let you win the entire challenge, why not try to snatch a spot on the second list? I'd be very interested to see how people tackle this challenge in a variety of languages!
To make sure that your answer shows up, please start your answer with a headline, using the following Markdown template:
# Language Name, N bytes

where N is the total size of your submission. If you improve your score, you can keep old scores in the headline, by striking them through. For instance:
# Ruby, <s>104</s> <s>101</s> 96 bytes

You may also include the individual counts before the total count, e.g.
# Python 2, 35 + 41 = 76 bytes

The last number that is not struck through will be used by the snippet.

<script src='https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js'></script><script>site = 'meta.codegolf',postID = 5314,isAnswer = true,QUESTION_ID = 42253;jQuery(function(){var u='https://api.stackexchange.com/2.2/';if(isAnswer)u+='answers/'+postID+'?order=asc&sort=creation&site='+site+'&filter=!GeEyUcJFJeRCD';else u+='questions/'+postID+'?order=asc&sort=creation&site='+site+'&filter=!GeEyUcJFJO6t)';jQuery.get(u,function(b){function d(s){return jQuery('<textarea>').html(s).text()};function r(l){return new RegExp('<pre class="snippet-code-'+l+'\\b[^>]*><code>([\\s\\S]*?)<\\/code><\/pre>')};b=b.items[0].body;var j=r('js').exec(b),c=r('css').exec(b),h=r('html').exec(b);if(c!==null)jQuery('head').append(jQuery('<style>').text(d(c[1])));if (h!==null)jQuery('body').append(d(h[1]));if(j!==null)jQuery('body').append(jQuery('<script>').text(d(j[1])))})})</script>

That leaderboard is cool!

Sounds like any Whitespace answer would comply with rule 1. ;)

@nyuszika7h Indeed it would, but it won't be particularly short anyway.

Significant whitespace, so not whitespace with benefits or anything...

So what in Bash count as string literals?

@user23013 As far as I'm aware, string literals in Bash can only include whitespace if they are surrounded in quotes, right? If so, then it would be "in the spirit of the law" to disallow only quoted string literals. (The idea behind disallowing string literals is to avoid some simple solutions, where you just include a space in a string and switch the behaviour depending on the length of the string.)

The snippet is not listing the rankings :(

Pyth, 16 + 15 = 31 bytes
Try it here.
Counter:
L@,cb)sm!cd)b1 0

Splitter:
L@,cb)sm!cd)b10

These each define a function, y, which takes a string input to solve the desired task.
Thanks to @FryAmTheEggman for the idea of using Pyth's feature of modular indexing into lists to shave a character.
Test cases:
L@,cb)sm!cd)b1 0y++"abc def"b"gh ij k"
L@,cb)sm!cd)b10y++"abc def"b"gh ij k"

Explanation:
L                  define a function, y, which takes one input, b.
 @                 Index into
  ,                2-tuple of
   cb)             b.split()                          (solution to splitter)
   s               sum over                           (solution to counter)
    m              map, with input d, to
     !cd)          logical negation of d.split()      (empty list is falsy)
     b             over b.
                   Index is either:
   10
   1
                   Indexing is modulo the length of the list in Pyth.
 0                 In one case, a 0 with a leading space is outside the function.
                   Leading space suppresses print, so the 0 is invisible.

Python, 54 + 56 = 110 bytes
Counter:
m=lambda x:sum(y.isspace()for y in x)
+1
0<9or x.split()

Splitter:
m=lambda x:sum(y.isspace()for y in x)+10<9or x.split()

For the counter, we use the fact that Python is okay with having just an expression on a line. It's necessary to split up +1 and 0<9or x.split() to stop a NameError from being thrown, as 0<9 being True prevents x.split() from being evaluated due to short circuiting.
For the splitter, since the number of whitespace is always nonnegative, sum(y.isspace()for y in x)+10<9 is always False and the splitting function comes into play.

Alternative 1, 59 + 60 = 119 bytes
Counter:
m=lambda x:[x.split(),sum(y.isspace()for y in x)][min([1])]

Splitter:
m=lambda x:[x.split(),sum(y.isspace()for y in x)][m in([1])]

The results of both counting and splitting are stored in a two-element list. The list is indexed by either min([1]), returning the minimum of the one-element list containing 1, or m in([1]), which returns False (equivalent to 0) as m is not contained in [1].

Alternative 2, 67 + 69 = 136 bytes
Counter:
ted=1;s=lambda x:[x.split(),sum(y.isspace()for y in x)][not s or ted]

Splitter:
ted=1;s=lambda x:[x.split(),sum(y.isspace()for y in x)][not sorted]

Like above, the results of both counting and splitting are stored in a two-element list. sorted is a built-in function which is a truthy value, so not sorted returns False (equivalent to 0). For not s or ted, since s is a function and also truthy, not s is False and ted = 1 is returned.

Alternative 3, 59 + 60 = 119 bytes
Counter:
def f(s):a=s.split();a1=len(s)-len((s*0).join(a));return a1

Splitter:
def f(s):a=s.split();a1=len(s)-len((s*0).join(a));return a
1

This is a function where splitter's result is stored in the variable a, and counter's result is stored in the variable a1. Like before, Python is fine with having just an expression on a line, in this case 1. Splitting up a1 determines what to return from the function.

I'd +1 again for not sorted.

Is the newline between +1 and 0<9or x.split() needed?

@isaacg If you care about exceptions, then yes

You can shave off 3 bytes with m=lambda x:sum(y.isspace()for y in x)+00and x.split() and m=lambda x:sum(y.isspace()for y in x)+0;0and x.split() (making that semicolon a newline of course)

@cjfaure I don't think the first one works as a splitter if there's no whitespace

@Sp3000 Oh yeah, if there's nothing at all it just returns 0. :c

sum(map(str.isspace,x)) is shorter by three characters! That would make your score 104 :)

@JamesElegan I saw it in feersum's answer but decided not to put it in because it's not going to win anyway :P

Java 8, 239 + 240 = 479
Count the whitespace (returns Integer)
Object f(String s){String r=new String(new char[]{92,'s'}),e=new String();int intx=0;intx=1;return intx>0?s.chars().filter(c->c==9|c==10|c==32).count():java.util.Arrays.stream(s.split(r)).map(t->t.replaceAll(r,e)).filter(t->t.length()>0);}

Split on the whitespace (returns Stream<String>)
Object f(String s){String r=new String(new char[]{92,'s'}),e=new String();int intx=0;int x=1;return intx>0?s.chars().filter(c->c==9|c==10|c==32).count():java.util.Arrays.stream(s.split(r)).map(t->t.replaceAll(r,e)).filter(t->t.length()>0);}

Explanation:
Object f(String s){
    String r=new String(new char[]{92,'s'}),e=new String();  // init regex'es

    int intx=0;     // critical variable

    intx=1;         // change intx to 1
              OR
    int x=1;        // new, unused variable

    return intx>0 ? // test variable to decide what to do
      s.chars().filter(c->c==9|c==10|c==32).count() :
      java.util.Arrays.stream(s.split(r)).map(t->t.replaceAll(r,e)).filter(t->t.length()>0);
}

To me, this looks brilliant. +1

Pretty good, considering that Java has to be the worst language for code golfing.

Whitespace, 75 + 153 = 228
Spaces, tabs and newlines substituted by STL, respectively, and folded for legibility. Convert to a proper Whitespace file with tr -d \\n | sed 'y/STL/ \t\n/'.
Counter
SSSLLSSLSSSTSSSSSLSLSSLSTLTSTTTSLSLTSSLTSSTLTTLSSSTLTSSSLSLLLSSSLS
LLSLLTLST

Splitter
SSSTLSSSLTTSLSSTLSSSLSLSTLTSTTTSLSSLSLTSLSSSTSSSSTLTSSTLTTTTLSSSTL
SLSTTSLSLSLLSSTTLSSSTSTSLSSSTLTTTLTSTSLTLSSSSSTLSSSLTTSLSSTSLLSLTL
LSSSLTLSSLSLTLLSSLLLL

I was wondering how long it would take... ;)

With whitespace, this becomes two separate code golfing challenges.

Marbelous, 103 + 92 = 195
Counter:
@0      @200@1@3
]]&1]]3W
  \\!!?001
        &0  >W@1
>W    @2/\  /\@3+A
00&0      &1
          Dp
@0//

Splitter:
@0  @200@1    @3
]]&1]]  3W    \\
  !!    ?001&0
>W@1>W@2
/\  /\@3+A00&0
          &1Dp@0
//

Test these programs here. Cylindrical Boards, Include Libraries, and spaces for blank cells must all be checked.
Input and Output are through STDIN/STDOUT.
Explanation
Counter:

The blue path receives input. If the character is a whitespace character (ascii value less than 0x21), the black path is taken, which synchronizes with the purple path.
The purple path simply increments a marble stored in the &1 synchronizer each time the black path is taken.
Once there is no more input, the red path is taken, printing the number of whitespace characters and exiting.
Splitter:

The program begins with the blue path, which loops until a non-whitespace character is found.
Once a non-whitespace character is retrieved, the black path is taken, which prints out this character and moves execution to the green path, which loops and prints until a whitespace-character is received. Execution then continues to the purple path, which contains 3W, or a three-way splitter.
The left branch moves execution to the blue path (and whitespace is discarded until a non-whitespace character is found).
The middle branch sets the copy of the input to 0 with ?0 (generate a random number between 0 and 0), and adds 10 (0x0A = newline), which is then outputted.
The right path is discarded.

It seems like the splitter doesn't terminate if there's trailing whitespace.

CJam, 26 + 27 = 53 59 61 73 77  bytes
Counter
'!q_,\SN9c++SerS%:Qs,-QN*?

Splitter
' !q_,\SN9c++SerS%:Qs,-QN*?

How it works
The idea is simple, calculate both number of whitespaces and split the string on consecutive runs of whitespaces. Then choose one of them based on the following fact that ' ! means not of space character which is falsy, while '! is the ! character, which is truthy.
Expanded code:
'! / ' !                              "Get truthy or falsy value";
        q_                            "Read the input, make a copy";
          ,\                          "Take the length of the copy and swap";
            SN9c++                    "Get a string comprised of all Whitespaces";
                  Ser                 "Replace any occurrence of any character of"
                                      "the above string with space";
                     S%               "Split on one or more runs of space";
                       :Qs,           "Store this in Q, flatten to a string and take length";
                           -          "Subtract from total length to get count";
                            QN*       "Put the splitted array on stack and join newline";
                               ?      "Base on the truthy or falsy value, pick one to print";

Input is from STDIN and output is to STDOUT
Try it online here

Mathematica, 44 + 43 = 87 97 bytes
I thought I'd add another language to the mix.
Counter:
StringCount[#,Whitespace]+0 1StringSpli t@#&

Splitter:
String Count[#,Whitespace]+01StringSplit@#&

This makes use of Mathematica's feature that space separation is the same as multiplication. And that multiplying something with 0 is always 0, and adding 0 to something is always idempotent.
For the counter, we first count the whitespace, and the we add 0*1*StringSpli*t@#. StringSpli and t aren't defined, but Mathematica uses symbolic computation, so it just treats those as an unknown variable and function. The 1* is idempotent (just as 0+), the 0* turns it into a zero. It is necessary to separate the StringSplit into two variables, because 0 times a list is treated as a scalar-vector multiplication which results in a vector (list) of zeroes.
For the splitter, I'm using the fact that Count also exists but doesn't look into strings. It tries to count all subexpressions matching the pattern, but Whitespace is a pattern that only applies to string contents. So Count will always return 0, which makes the String vanish. The multiplication of the split array by 01 = 1 is again idempotent.

Ruby, 107 91 bytes
Splitter (46 bytes)
p
p=gets(p).split
puts p||$_.size-pp.join.size

Counter (45 bytes)
pp=gets(p).split
puts p||$_.size-pp.join.size

p is a predefined method that, with no arguments, just returns nil. We use this in several ways. In the splitter, the initial p does nothing. gets(p) reads in everything from standard input, since the delimiter is null. We call the built-in split method on that, and assign the result to p, so now when it's not given arguments it'll be parsed as a variable. puts p||... short-circuits and prints each element of the p variable to its own line.
In the counter, we delete the first newline so that the split array is assigned to pp instead. Since we haven't assigned to p, it's still the nil-returning method so the second part of the || gets evaluated and passed to puts. $_ is a magic variable containing the result of gets, so the total amount of whitespace is the size of that minus the non-whitespace characters, which are what pp contains. I feel like there should be a shorter way of doing the counting, but I can't find one, and at any rate using the split array in the counter is fun.

Python, 169
It's almost too easy to do this in Python!
Counter:
def x(s):
 def y(s):
  return sum(map(str.isspace,s))
  return s.split()
 return y(s)

Splitter:
def x(s):
 def y(s):
  return sum(map(str.isspace,s))
 return s.split()
 return y(s)

They differ in only one space, and I'm not doing any trickery like splitting a number or a variable name in half :)

C, 138+136 = 274
In each case, the code is a program that accepts exactly one command-line argument and prints the result to stdout. \t should be replaced with a tab character. If you want to pass an argument containing tabs and newlines, it's your job to figure out how ;).
Counting
#define strtok strpbrk
h=' \t\n';main(c,v,n)char**v;{for(n=- -c-1;v[n]=strtok(1[v],&h);n[v]++)v[!n]=0,puts(*v),c++;n*='d%';printf(&n,c-2);}

Splitting
#define strtokstrpbrk
h=' \t\n';main(c,v,n)char**v;{for(n=--c-1;v[n]=strtok(1[v],&h);n[v]++)v[!n]=0,puts(*v),c++;n*='d%';printf(&n,c-2);}

JavaScript, 95 + 96 = 191 bytes
Counter:
c=(a,v)=>{v
v=a=a.split(RegExp(String.fromCharCode(92,115)));return v?a.length-1:a.filter(j=>j)}

Splitter:
s=(a,v)=>{vv=a=a.split(RegExp(String.fromCharCode(92,115)));return v?a.length-1:a.filter(j=>!!j)}

Ungolfed:
s=(a,v)=>{

    v  // this `v` is ignored, or combined with the next line to make `vv`

    // split array and store it in `a` and `v` (or alternatively `vv`)
    v = a = a.split(RegExp(String.fromCharCode(92,115)));

    return v?
            a.length-1        // return number of whitespace chars
            :
            a.filter(j=>j)    // return array without empty strings
    }

The RegExp(String.fromCharCode(92,115) line creates the whitespace-matching regex /\s/ without regex or string literals.
In each program, we use the variable v or vv. We store the split array into that variable (v or vv), and then branch our behavior on the value of v (meanwhile, vv is ignored). In the counter, v has a truthy value; in the splitter it has a falsy value (because vv got the value instead).

Alternate: JavaScript, 250 bytes
I have another solution that isn't winning any prizes for brevity, but I thought it was an interesting challenge to abuse JavaScript's automatic semicolon insertion behavior.
Counter:
c=a=>{a=a.split(RegExp(String.fromCharCode(92,115)));x:for(i=2;i--;)for(o=i?a.length-1:a.filter(j=>j);1;){break x}return o}

Splitter:
s=a=>{a=a.split(RegExp(String.fromCharCode(92,115)));x:for(i=2;i--;)for(o=i?a.length-1:a.filter(j=>j);1;){break
x}return o}

Ungolfed counter:
s=a=>{
    a = a.split(
            RegExp(String.fromCharCode(92,115))   // split input on whitespace regex /\s/
        );
    x:                             // x is a label for the outer loop
    for(i=2;i--;)                  // run this outer loop twice
        for(o=i?                   // if this is the first outer loop pass,
               a.length-1          //    set `o` to number of whitespaces
               :                   // else, on second outer loop pass,
               a.filter(j=>j);     //    set `o` to split input (w/o empty strings)
            1;                     // 1 is truthy; run inner loop forever
            ) {
                break x;           // break out of outer loop
            }
    return o;                      // return `o`
}

The splitter is exactly the same, except for the line:
break x;

is now
break
x;

JavaScript's automatic semicolon insertion normally does not terminate multi-line statements early if they can be understood without a line break, but it does not tolerate line breaks after return, continue or break. Therefore, the line is read simply as break, which breaks out of the inner loop only, instead of breaking out of the outer loop. The "second-pass" behavior o = a.filter(j=>j) is then executed (versus being skipped in the counter), because the outer loop is given a second pass.

Is !!x different to the auto Bool convert?

@l4m2 It is not! I have removed it, since filter auto-bools its callback return by the same rules as !!. Thanks!

Python, 228 198 182 166 146 145 bytes

Counter (72 bytes):
ior1=0
w=lambda i:i.split()if ior1 else sum(ord(c)in(9,10,32)for c in i)

Splitter (73 bytes):
ior1=0
w=lambda i:i.split()if i or 1else sum(ord(c)in(9,10,32)for c in i)

ior1 is a falsey variable, but i or 1 is truthy. That's the main trick.

Doesn't this break if i is the empty string for the splitter? Could be fixed by changing iorb to ior1, which also lets you save the character between 1 and else.

@isaacg I totally forgot that you could have numbers in variable names! Thank you <3

Befunge 98, 61 + 59 = 120
Counter:
~:'!-0`#v_ >$1+#@ #. #
 @#,#$ #<_v#`0-!':~ # .#
  ,#$ #+55<v

Splitter:
~:'!-0`#v_ >$1+#@ #.#
 @#, #$#<_v#`0-!':~ #.#
  , #$#+55<v

Bash, 75 + 79 = 154 bytes

This relies on bash being able to continue execution even if some lines or parts of a line of the script are malformed (in some circumstances).  Whitespace is used to deactivate escapes for some close brackets, and to break a pipe by putting it on a new line.
Splitter:
echo $((`echo $1|wc -w`+${#1}-$(\)\)\)
for a in $1;do echo $a;done|wc -c)))

Counter:
echo $((`echo $1|wc -w`+${#1}-$(\ )\ )\ )
for a in $1;do echo $a;done
|wc -c)))

Input is via commandline argument, output is via stdout.
Because this relies on bash error behaviour, the user is expected to ignore stderr.
Example run (showing input with a newline and multiple contiguous spaces):
# bash counter.sh "abc def
gh   ij k" 2>/dev/null
6
# bash splitter.sh "abc def
gh   ij k" 2>/dev/null
abc
def
gh
ij
k

Ruby, 114 + 116 107 + 109 = 216 bytes
This can't compete with the ruby solution by histocrat, but I thought it would be worth putting up anyway.
I used $z for nil and nil.to_s for String.new
The extra whitespace character that I add to the end of the input is to force the last word to be added to the array (r) - a word is only added to the end of the array when a whitespace character follows a non-whitespace character. The alternative was adding another r<<w if w after the each_byte block.
Counting
->s{r=[]
n=-1
w=$z
(s+9.chr).each_byte{|b|if b<33
r<<w if w
w=$z
n+=1
else
w=w.to_s+b.chr
end}
$zorr ?r:n}

Splitting
->s{r=[]
n=-1
w=$z
(s+9.chr).each_byte{|b|if b<33
r<<w if w
w=$z
n+=1
else
w=w.to_s+b.chr
end}
$z or r ?r:n}

Ah, I wasn't sure about the ruling on that one. I've changed it to use if-else instead of the ternary operator - no more string literals.

Haskell, 53 + 55 = 108 36 + 38 = 74 bytes
Counter
f=do
 pure(length.filter(<'!'))words

Splitter
f=do
 pure(length.filter(<'!'))
 words

This solution makes use of the fact that in Haskell functions are an instance of the Monad type class and thus can be used as monadic actions in do-notation.
In the first case the resulting function of the do-block is the first argument of pure (which is essentially const for the function type), making the counter the final result and the splitter being discarded.
In the second case pure is only applied to a single argument, making it a function that returns another function (the counter). However, the result is never used and thus discarded. The final result is the second line of the do-block, the splitter.

Nice approach! [' ','\t','\n'] can be shortened to " \t\n".

@Laikoni The description only allows character literals, no string or regex literals

Because the challenge doesn't require you to handle most control characters, you can shorten this by using (<'!') to test for whitespace.

Java 8, 187 + 188 = 375
First of all, I'd like to say that this answer is heavily based on @Ypnypn's. I basically replaced some parts with shorter ones (including the whitespace-dependent part, which IMO is the most important in this challenge), but the functional code is mostly the same.
Count the whitespace, 187 (returns int):
Object f(String s){String r=new String(new char[]{92,115});int a=0;return a--+a>0?s.chars().filter(c->c>8&c<11|c==32).count():java.util.Arrays.stream(s.split(r)).filter(t->t.length()>0);}

Split on the whitespace, 188 (returns Stream<String>):
Object f(String s){String r=new String(new char[]{92,115});int a=0;return a- -+a>0?s.chars().filter(c->c>8&c<11|c==32).count():java.util.Arrays.stream(s.split(r)).filter(t->t.length()>0);}

J, 48 + 49 = 97 char
Two functions taking and returning a single argument. Used the crappiest way that I could think of to beat the same-but-whitespace rule, so there are probably characters to be saved by finding a more clever route around that.
(aa[aa=.+/@a=.a:-.~(e.u:)&9 10 32 :(<;._1~1,}.))      NB. count
(a a[aa=.+/@a=.a:-.~(e.u:)&9 10 32 :(<;._1~1,}.))     NB. split

We define the verb a to have two different actions, depending on whether it's used with one argument or with two. With one argument, it is (e.u:)&9 10 32, which checks if each character is whitespace or not. With two arguments, it is a:-.~(<;._1~1,}.), which takes a boolean vector on the right and cuts the left argument at those positions, throwing out any empty cuts with a:-.~.
Then, we define aa to be number of True values in the result of a, which only makes sense with one argument. Finally, we use aa or a a depending on whether we want to count or split the whitespace of the string. aa works as expected.
The reason a a works is because when J sees (f g)y, it considers (f g) a hook and evaluates it like y f (g y). In this case, f is the dyadic a above which does the cutting, and g is a[aa, which calculates the sum from aa, throws it out, and calculates (monadic) a again.
At the REPL:
   (aa[aa=.+/@a=.a:-.~e.&(u:9 10 32) :(<;._1~1,}.))   '  123',TAB,'-_-   abc',LF,'def'
7
   (a a[aa=.+/@a=.a:-.~e.&(u:9 10 32) :(<;._1~1,}.))  '  123',TAB,'-_-   abc',LF,'def'
+---+---+---+---+
|123|-_-|abc|def|
+---+---+---+---+

Bash, 54 + 50 = 104 bytes
Counter
a=$IFS
IFS=
cat()(tr -cd $a|wc -c)
printf %s \\n$1|cat

Splitter
a=$IFSIFS=ca
t()(tr-cd$a|wc-c)
printf %s\\n $1|cat

Perl, 37 + 38 = 75
Counter:
sub f{($_)=@_;(y/   - //,[split])[0.1]}

Splitter:
sub f{($_)=@_;(y/   - //,[split])[0 .1]}

Perl 6, 31 + 32 = 63 bytes
Counter
{?^1??.words!!+grep 33>*,.ords}

Try it online!
?^1 is parsed like ?^ 1 which applies the Boolean negation operator to 1, resulting in False.
Splitter
{? ^1??.words!!+grep 33>*,.ords}

Try it online!
? ^1 converts the range 0..0 to Bool, resulting in True.

Python 2, 98
Splitting (49)
Returns the tokens in a list.
f=lambda s:[sum(map(str.isspace,s))]and s.split()

Counting (49)
Returns a list of length one containing the number of space characters. It will most likely cause a runtime error, but the function f can be used after executing the code.
f=lambda s:[sum(map(str.isspace,s))]
ands.split()

C (gcc), 88 + 89 = 177 bytes
Splitter
i,n,x,c;f(char*s){x=n=i=0;for(x+++n;c=*s++;c*x&&putchar(c))i=c<33?n++,c=i*10,0:1;x=n-1;}

Splitter
Counter
i,n,x,c;f(char*s){x=n=i=0;for(x+ ++n;c=*s++;c*x&&putchar(c))i=c<33?n++,c=i*10,0:1;x=n-1;}

Counter
Rundown
Takes input as a function argument. The counting function returns the number of whitespace. The splitting function uses STDOUT for its output (but incidentally returns number of whitespace minus one as well).
i,                      Flag signalling whether we are inside a word.
n,                      Number of whitespace encountered.
x,                      Flag signalling whether or not we should output the words.
c;                      Current character.
f(char*s){              Take input string as an argument.
x=n=i=0;for(            Initialise everything and start loop.
x+++n;                  SPLITTER ONLY: Interpreted as x++ +n, meaning x is set to 1 and n stays 0.
x+ ++n;                 COUNTER ONLY: Inverse of the above. Sets n to 1, and x stays 0.
c=*s++;                 Sets c to current char and increment string pointer, end loop if end of string.
c*x&&putchar(c))        Only output c if x is 1 and c is non-zero, which only happens if we left a word.
i=c<33?                 Since input contains only printable ASCII or whitespace, anything below 33 is whitespace.
       n++,             ...if that is the case, increment the whitespace counter (n)
           c=i*10,      ...and set c to newline (10), but only if we just left a word (if i is 1)
                  0:    ...and set i to 0.
                    1;  If not a whitespace, set i to 1, signalling we are inside a word.
x=n-1;}                 Implicitly returns n-1, which is the number of whitespaces if we are in the counter function.

Zsh, 35+35=70 bytes

Neither program/function may contain any string or regex literals

I am unsure whether [^$IFS] qualifies, since it is used in pattern matching. Here is a 45+45 solution in the case it is banned.

Split:
:<<<${#1//[^$IFS]}
:
<<<${(F)${=1}}

Count:
:
<<<${#1//[^$IFS]}
:<<<${(F)${=1}}

The : builtin is equivilent to true, we use it as something between a comment and /dev/null (since comments are disallowed) by piping the unwanted expansion to it.
Zsh has a builtin for splitting on whitespace, that being ${=var}. This makes it hard to do any kind of logical combination other than just executing both and discarding the one we don't want.
Try it online!

authors: Вероника Кулешова

authors: Ирик Ярмушев

authors: Николай Образцов

authors: ᬼسہلہSALOMومٰہٰٖ

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

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


text:
Make a working digital clock with ascii numbers
The challenge is make a digital clock that exhibits ascii numbers in a 24-hour format like:
 _   _     _   _
|_| |_| . |_| |_|
|_| |_| . |_| |_|

or
 _   _         _
 _|  _| . |_| |_
|_   _| .   |  _|

and updates the screen every 1 minute (or every 1 second, for praticity reasons). It must reset to 00:00 after 23:59.

Very closely related.

Even more closely related: I would vote to close as a dupe if I didn't have superpowers.

I think, clock with timer aren't the same as any number.

Python, 411 408 chars
import time,os
s=" ";p=".";a=s*3;b=" _ ";c="|_|";d="| |";e="|  ";f="  |";g="|_ ";h=" _|";P=[s,p,p]
z=[[b,d,c],[a,f,f],[b,h,g],[b,h,h],[a,c,f],[b,g,h],[b,g,c],[b,f,f],[b,c,c],[b,c,h]]
A=range(10);B=A[:6];C=A[:3]
while 1:
 for i in C:
  for j in A:
   if i==2&(j==4):break
   for k in B:
    for l in A:
     for m in C:
      print z[i][m]+s+z[j][m]+P[m]+z[k][m]+z[l][m]
     time.sleep(1);os.system('clear')

Not so pretty but working.

authors: خالد ابوبهجت


text:
"Atomic" code golf - determine the number of neutrons in an isotope
Your task is to take an string containing an isotope of an element as input, encoded like the following example with the atomic number followed by a space and the IUPAC chemical symbol for the element:
162 Dy

and return the number of neutrons in an atom of that isotope.
In the above example, dysprosium-162 has 96 neutrons (162 total nucleons, minus 66 protons because it's dysprosium), so the output should be 96.
You may assume that the element given will be one of the 114 elements currently given permanent names by the IUPAC (including flerovium and livermorium) and not a generic name such as Uus for "ununseptium". You may also assume that the atomic number of the isotope will not exceed 1000, or be less than the number of protons in the element.
You may not use built-ins to retrieve data about the proton or neutron number of elements, or use any function within your code that evaluates a string or number token as code on its own.
The program to use the fewest tokens to do this in any language wins. However, for the purpose of this challenge, every character in a string, or a variable name converted into a string, counts as a token.
List of elements and their atomic number for reference:

{
    "H": 1,
    "He": 2,
    "Li": 3,
    "Be": 4,
    "B": 5,
    "C": 6,
    "N": 7,
    "O": 8,
    "F": 9,
    "Ne": 10,
    "Na": 11,
    "Mg": 12,
    "Al": 13,
    "Si": 14,
    "P": 15,
    "S": 16,
    "Cl": 17,
    "Ar": 18,
    "K": 19,
    "Ca": 20,
    "Sc": 21,
    "Ti": 22,
    "V": 23,
    "Cr": 24,
    "Mn": 25,
    "Fe": 26,
    "Co": 27,
    "Ni": 28,
    "Cu": 29,
    "Zn": 30,
    "Ga": 31,
    "Ge": 32,
    "As": 33,
    "Se": 34,
    "Br": 35,
    "Kr": 36,
    "Rb": 37,
    "Sr": 38,
    "Y": 39,
    "Zr": 40,
    "Nb": 41,
    "Mo": 42,
    "Tc": 43,
    "Ru": 44,
    "Rh": 45,
    "Pd": 46,
    "Ag": 47,
    "Cd": 48,
    "In": 49,
    "Sn": 50,
    "Sb": 51,
    "Te": 52,
    "I": 53,
    "Xe": 54,
    "Cs": 55,
    "Ba": 56,
    "La": 57,
    "Ce": 58,
    "Pr": 59,
    "Nd": 60,
    "Pm": 61,
    "Sm": 62,
    "Eu": 63,
    "Gd": 64,
    "Tb": 65,
    "Dy": 66,
    "Ho": 67,
    "Er": 68,
    "Tm": 69,
    "Yb": 70,
    "Lu": 71,
    "Hf": 72,
    "Ta": 73,
    "W": 74,
    "Re": 75,
    "Os": 76,
    "Ir": 77,
    "Pt": 78,
    "Au": 79,
    "Hg": 80,
    "Tl": 81,
    "Pb": 82,
    "Bi": 83,
    "Po": 84,
    "At": 85,
    "Rn": 86,
    "Fr": 87,
    "Ra": 88,
    "Ac": 89,
    "Th": 90,
    "Pa": 91,
    "U": 92,
    "Np": 93,
    "Pu": 94,
    "Am": 95,
    "Cm": 96,
    "Bk": 97,
    "Cf": 98,
    "Es": 99,
    "Fm": 100,
    "Md": 101,
    "No": 102,
    "Lr": 103,
    "Rf": 104,
    "Db": 105,
    "Sg": 106,
    "Bh": 107,
    "Hs": 108,
    "Mt": 109,
    "Ds": 110,
    "Rg": 111,
    "Cn": 112,
    "Fl": 114,
    "Lv": 116
}

Ahaha right, just read the tag wiki. Seems like I misunderstood what the tag encompassed.

So by tokens, you mean K or a in CJam are single tokens just like String amd .repeat are ?

@Optimizer Yes, exactly.

In general, atomic code golf is better than code golf in terms of fairness between languages because it doesn't favour golfing-specific languages like CJam or Golfscript.

Yes, none of those elements will be entered as input.

Are numbers considered as single token ? Like in my answer, is 65 a single token or 2 tokens ?

Those are naturally disallowed.

How are tokens counted in function calls. Is f(a,b) 3, 4, 5 or 6 tokens?

@JoeZ. What about my numbers query ?

"In general, atomic code golf is better than code golf in terms of fairness between languages because it doesn't favour golfing-specific languages like CJam or Golfscript." Or does it? ;)

If built-ins were allowed, the following function, written in Mathematica, might be used: f[i_] := {n =       ElementData[#[[2]], ToString@"StandardName"] <> ToString[#[[1]]],      IsotopeData[n, "NeutronNumber"]} &[i]

CJam, 120 6 or 116 tokens
If numbers are single token, then we have the whole code as 6 tokens:
212065132249371573644124577121541653292994215804249878509033804566332949723850494006885998432589817663973272353884582668784347806472090795216938149345570424681103578762377771127645936569136562173556524971260383556793671988140498193154122873972644190003488894117491373991987567199279175132071186860926217964652052981868515510731685503564515183920386542420190587555479397630718313762477968862282786518176572529906744217608955037610524188966159703528812103601771438848515748286560373093942224945233978303729665751831532717 128b:c~

where the tokens are
212065132249371573644124577121541653292994215804249878509033804566332949723850494006885998432589817663973272353884582668784347806472090795216938149345570424681103578762377771127645936569136562173556524971260383556793671988140498193154122873972644190003488894117491373991987567199279175132071186860926217964652052981868515510731685503564515183920386542420190587555479397630718313762477968862282786518176572529906744217608955037610524188966159703528812103601771438848515748286560373093942224945233978303729665751831532717
128
b
:
c
~

This code is equivalent to the below code containing the string version of the big number in the above code. But due to a string, the below code has 116 tokens:
ri"ᘭ᛭绊ڏ晍嬨塐弶⛡ᠸ庐ᖩે槑湘ࡊ㚋䊌栕ᄂỗ∘抁埵ໂČ槩唹ᘇ穗≧ṷ㴛勤烓≿Ⲳ㇭Ȋ嬅͙獚簜䱡数㍉㉦䩛爈拴矍㚴燌㾄䱮⃜⢴ⶏ㯗႒ݘ੡䅄瞟⮘㢧⳻⮵∼䚽珯ほֹ㳰櫣ݰ牜᫦殙ᆌ穟䖻ᄭⓚ獙஧༧撒咛啺"2F#b57b65f+:cr2*2<#2/)-

Tokens (with explanation) are
r                           "Read the first input";
i                           "and convert it to integer";
"
91 character string         "Then this base converted string";
"
2
F
#                           "'s ASCII representation of each character gets converted";
b                           "to base 2**15";
57                          "which gets converted to";
b                           "base 57";
65                          "and we add 65 to each element in the base 57 array";
f
+
:
c                           "and convert each array element to character.";
r                           "Then read the next input string, which is atom's IUPAC";
2                           "double it";
*
2                           "and take only first 2 characters";
<
#                           "Find the occurrence of these 2 characters in the big string";
2                           "and divide the index by 2";
/
)                           "increment the index to counter 0 offset";
-                           "and subtract this number, which is the atomic number from"
                            "the input number of nucleons";

To run the above string, copy the code from this link as SE removes some characters while uploading the answer.
This can be reduced to 109 tokens too, but then SE won't let me upload my answer, throwing malformed URI exception.
Input goes like
162 Dy

output is like
96

The weird string is just a base encoded string containing all IUPAC names at their Atomic number * 2 - 1 index.
Try it online here

Why would numbers not be a single token?

@MartinBüttner Well, if for the purpose of this question, strings are not single token, then numbers might not be too :)

This gives the wrong the results for Boron and Indium, because two-element letters starting with B and I appear before them.

^ You mean boron and iodine. Indium is In.

Also, guys. That bug for B and I is fixed.

Python 3 with exec, 17 tokens
exec(int.to_bytes(42580960806925240587487231677747050990110980939298529158008049507419456038066480774222358994792932281429500848123044123619998194774734911333011516763318834841258668032468977581617546825403043048781904307873076644287421190283925612029151422009703963147720234582458918676020358978146687598642493196719470433413287097024943497230356536978257362073205770196031226838532057690859535911353521203287284228407660035870497366713816359382867026152168356178620422021081074864815228071041303891869741111572003521808946355179139580269537828514345177247630946236685801543450404664783011350766913659964138280312012942354586269107632396118108534925651704031851802293836135007879834261627022944650861299698061444211422731907625,295,'big'))

Python 3 without exec, 35 tokens
m,n=input().split()
print(int(m)-(0x50000003c00000000000000000000000000000000000000000000000000000000000000000000000000000000008c00000000000000000000000000000000000000000000000000000000d80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000116880005ad0000d002b832400000000000000000000000000000004c0000064f8000003806a0088015660000000000000000000000000000b00000000000ac0000000016efd12c0004b60000000000000000000000000000000000000000000000000000000000000000000000000000000000000000017a700760005400f400000000000001700a56c000000000000000000000000000004c0000000000000000000000000000000000000000000000000000000000000000002ee6000000000700000029e00522c0000000000000000000000000003680000002a3200000000000c00032800000000000000000000000000000e91c000ce000000000000000c000000000000e400000000000000000000000000000004800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009a000006200000000000000000000000000000000000000000000000000006c0000043000000000000509008000000000000000000000000000000000000000000000000000000000000082000007c0000000000000000000000000000000ae00000019390000000000068000000000000000000000000000000000fc06388000000000000000000000000000000000000000000000000108000000006e0000000000000000000000000000d2000000000000000000000000000074037300001be1808800000000c4e98000050000000000000000000000000000000046000000000061014f580001000000e0000000000000000000000000013eaa12400000017c680000002f0000059000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009c04a2f7001000007880e0001300d408012000060a0000000000000000000>>7*int(n,36)&127))

Ruby with eval, 17 tokens
eval [22146635005300445083784033446026580324048447941091204274213253110537099437818224958820496527991920943430421799402248351995854377736142191462062582991150146209770141259010870255095388946677505144127700666745571877848513432112199556183753919673308110291261587736766001750331575554182707626697924148465335917814388410868486650419909619279250674754531982074694183257024218097391705830277480110741636037821082572926228904583257826932150641336017429157246896262085081972165351023141358378905645164343005169041637147077645200273099823888392038731180787177889720531999846231330677441270444855911286469030157575699579420898896870179419644019549285098577609138033580761786048462145007410.to_s(16)].pack('H*')

Javascript, 49 tokens
m=prompt().split(/ /);
alert(m[0]-(function(){
_H_He_Li_Be_B_C_N_O_F_Ne_Na_Mg_Al_Si_P_S_Cl_Ar_K_Ca_Sc_Ti_V_Cr_Mn_Fe_Co_Ni_Cu_Zn_Ga_Ge_As_Se_Br_Kr_Rb_Sr_Y_Zr_Nb_Mo_Tc_Ru_Rh_Pd_Ag_Cd_In_Sn_Sb_Te_I_Xe_Cs_Ba_La_Ce_Pr_Nd_Pm_Sm_Eu_Gd_Tb_Dy_Ho_Er_Tm_Yb_Lu_Hf_Ta_W_Re_Os_Ir_Pt_Au_Hg_Tl_Pb_Bi_Po_At_Rn_Fr_Ra_Ac_Th_Pa_U_Np_Pu_Am_Cm_Bk_Cf_Es_Fm_Md_No_Lr_Rf_Db_Sg_Bh_Hs_Mt_Ds_Rg_Cn_Uut_Fl_Uup_Lv_
}).toString().split(/_/).indexOf(m[1]))

Just to illustrate Count big-ints/symbols/variables as N tokens in atomic-code-golf :)

Does disallowing eval and exec work against that?

@JoeZ. Still vulnerable to "big integer lookup table" attack, see update.

It seems like this problem was ill-formed from the start, then.

Javascript, 42 tokens (?)
alert(parseInt(x=prompt().split(" "))-Object.getOwnPropertyNames({__H_HeLiBeB_C_N_O_F_NeNaMgAlSiP_S_ClArK_CaScTiV_CrMnFeCoNiCuZnGaGeAsSeBrKrRbSrY_ZrNbMoTcRuRhPdAgCdInSnSbTeI_XeCsBaLaCePrNdPmSmEuGdTbDyHoErTmYbLuHfTaW_ReOsIrPtAuHgTlPbBiPoAtRnFrRaAcThPaU_NpPuAmCmBkCfEsFmMdNoLrRfDbSgBhHsMtDsRgCn__Fl__Lv:0})[0].indexOf(x[1])/2)

PS: Where I can find some script to count tokens?