text:
The World's Smallest Web Browser
Backstory:

You enjoy your new programming job at a mega-multi-corporation. However, you aren't allowed to browse the web since your computer only has a CLI. They also run sweeps of all employees' hard drives, so you can't simply download a large CLI web browser. You decide to make a simple textual browser that is as small as possible so you can memorize it and type it into a temporary file every day.

Challenge:
Your task is to create a golfed web browser within a command-line interface. It should:

Take a single URL in via args or stdin
Split the directory and host components of the URL
Send a simple HTTP request to the host to request the said directory
Print the contents of any
 paragraph
 tags
And either exit or ask for another page

More Info:
A simple HTTP request looks like this:
GET {{path}} HTTP/1.1
Host: {{host}}
Connection: close
\n\n

Ending newlines emphasized.
A typical response looks like:
HTTP/1.1 200 OK\n
<some headers separated by newlines>
\n\n

....rest of page

Rules:

It only needs to work on port 80 (no SSL needed)
You may not use netcat
Whatever programming language is used, only low-level TCP APIs are allowed (except netcat)
You may not use GUI, remember, it's a CLI
You may not use HTML parsers, except builtin ones (BeautifulSoup is not a builtin)
Bonus!! If your program loops back and asks for another URL instead of exiting, -40 chars (as long as you don't use recursion)
No third-party programs. Remember, you can't install anything.
code-golf, so the shortest byte count wins

Python, import webbrowser;webbrowser.open(url)

@muddyfish read the rules

Another fuzzy point is the request itself. Some websites will accept incomplete or non-standard requests. I suggest you include an example request (to e.g. example.com) and the expected output.

Can you provide a sample web page of some sort for testing this? It is difficult to find places that use  :P

@quartata try Wikipedia

@quartata example.com would be perfect. It is guaranteed to never change its content and is relatively small.

@minxomat sure, when I get back on my computer

@minxomat it shouldn't be too hard. I'll clarify the request soon

@TheDoctor Nevermind, that was a dumb question that you've already answered ...

Are we allowed to parse HTML using regex? ;-)

The restriction to low-level socket interfaces seems to prohibit the TCP-level APIs of most languages which have TCP-level APIs.

Related: http://codegolf.stackexchange.com/questions/44278/debunking-stroustrups-debunking-of-the-myth-c-is-for-large-complicated-pro

@DigitalTrauma good luck

@PeterTaylor I intended that to mean only a simple TCP API was allowed... Clarification soon

Wouldn't all headings h1 … h6 be important, too? If you  actually aren't allowed to read you may need to hurry and rush through the content.

Do the contents of each
...
 need to be printed on separate lines or can the output be dumped all in one log line?

@DigitalTrauma it should be newline separated

Is HTTP 1.1 mandatory? A simple HTTP request is even simpler: "GET $path HTTP/0.9\r\n\r\n"

The second and fourth lines do the same thing: replace every gap in the succeeding line with the appropriate character. They jump to the next line at the end.

Is IO:Socket::INET considered low-level enough?

@DomHastings Seems as low as the Bash and PHP entries. Open a socket, write and read.

Totally off-topic: any mega-multi-corporation that makes it this hard for their developers to access the internet is not worth working for IMHO. As a developer, I need Google and Stackoverflow on a daily, sometimes even hourly basis to search for solutions. Not having access to these essential tools is like not giving a commercial pilot access to his radio.

Just download it again. Every day.

Nitpicking: the newlines in an HTTP request are actually \r\n.

If the CLI is bash, wget might be preinstalled.

@CeesTimmerman wget isn't a socket API

@TheDoctor So the bold line wouldn't apply to it, hence the no install rule, which also doesn't apply if it's pre-installed.

@CeesTimmerman But wget handles all the HTTP request internally, which isn't allowed.

What's this "(as long as you don't use recursion)" about?

@Bergi Using recursion would eventually cause a Stack Overflow given enough browsing.

@TheDoctor: That would depend on the language and its ability of tail call optimisation. A recursive approach is totally standard in Haskell or JS

small in what sense?? code lines or executable size??

So small that you can remember it. Which is hard. Some people can remember pages of code, but I would have trouble remembering just wget, less and  grep to perform this task, even though they let you build a full fledged browser in under 10 lines.

Given the requirement why don't I download a small cli browser every time need?

Pure Bash (no utilities), 200 bytes - 40 bonus = 160
while read u;do
u=${u#*//}
d=${u%%/*}
exec 3<>/dev/tcp/$d/80
echo "GET /${u#*/} HTTP/1.1
host:$d
Connection:close
">&3
mapfile -tu3 A
a=${A[@]}
a=${a#*
}
a=${a%
*}
echo "${a//<\/p>*
/"
"}"
done

I think this is up to the spec, though of course watch out for parsing HTML using regex I think the only thing worse than parsing HTML using regex is parsing HTML using shell pattern matching.
This now deals with
...
 spanning multiple lines.  Each
...
 is on a separate line of output:
$ echo "http://example.com/" | ./smallbrowse.sh
This domain is established to be used for illustrative examples in documents. You may use this     domain in examples without prior coordination or asking for permission.
More information...
$

You need to have this memorized by tomorrow.

It doesn't give me paragraph text. Only tags inside the paragraph. example.com >>>
More information...

@TheDoctor fixed for
...
 spanning multiple lines - and a bit shorter too!

+∞ for "parsing HTML using shell pattern matching"

-1 because your avatar is subliminal messaging

This will take any scheme like alkdfjlkdj://example.org saving a few bytes. That should be fixed.

...you can make TCP connections from Bash? Now I am truly terrified!

Note: /dev/tcp is an optional extension and may not be present in your build of bash. You need to compile with --enable-net-redirections to have it.

@Schwern I'm not sure if I totally get your point.  There is nothing in the spec that I see about sanitising the input URL

@ChrisDown Looking in the bash-4.3 configure script, I see opt_net_redirs=yes, i.e. while this is an option, it is enabled by default.  Its also a documented feature.  So I don't think the fact that this feature may be disabled requires that it needs to be handled in any special way from the [tag:code-golf] scoring point of view.  The question of interpreter build-time options is interesting though and I don't think has been brought up on meta...

@ChrisDown OK, so I posted this meta question to get the community consensus on this.  I hope I've written it fairly and unbiasedly, though please feel free to edit or comment as you see fit.

@MathematicalOrchid If that terrifies you, you should not, I repeat, should not check out testssl.sh.

PHP, 175 bytes (215 - 40 bonus) 227 229 239 202 216 186 bytes
Have fun browsing the web:
for(;$i=parse_url(trim(fgets(STDIN))),fwrite($f=fsockopen($h=$i[host],80),"GET $i[path] HTTP/1.1
Host:$h
Connection:Close

");preg_match_all('!
(.+?)
!si',stream_get_contents($f),$r),print join("
",$r[1])."
");

Reads URLs from STDIN like http://www.example.com/. Outputs paragraphs separated by newline "\n".

Ungolfed
for(; $i=parse_url(trim(fgets(STDIN))); ) {
    $h = $i['host'];
    $f = fsockopen($h, 80);

    fwrite($f, "GET " . $i['path'] . " HTTP/1.1\nHost:" . $h . "\nConnection:Close\n\n");

    $c = stream_get_contents($f)

    preg_match_all('!
(.+?)
!si', $c, $r);
    echo join("\n", $r[1]) . "\n";
}

First version supporting one URL only
$i=parse_url($argv[1]);fwrite($f=fsockopen($h=$i[host],80),"GET $i[path] HTTP/1.1\nHost:$h\nConnection:Close\n\n");while(!feof($f))$c.=fgets($f);preg_match_all('!
(.+?)
!sim',$c,$r);foreach($r[1]as$p)echo"$p\n";

Edits

As pointed out in the comments by Braintist, I totally forgot to include the path. That's fixed now, thanks. Added 30 bytes.
Saved 3 bytes by resetting $c (holds the page content) with $c=$i=parse_url(trim(fgets(STDIN))); instead of $c=''.
Saved 12 bytes by replacing \n with new lines (5 bytes), one while-loop with for (2 bytes), placing nearly everything into the expressions of for (2 bytes) and by replacing foreach with join (3 bytes). Thanks to Blackhole.
Saved 3 bytes by replacing fgets with stream_get_contents Thanks to bwoebi.
Saved 5 bytes by removing the re-initialization of $c as it isn't needed anymore $c at all.
Saved 1 byte by removing the pattern modifier m from the Regex. Thanks to manatwork

Related: http://stackoverflow.com/a/1732454/4766556

So you can only ever read the home page (/) with this?

@briantist Oh man, I totally missed that. :D Thanks, it's fixed now.

I can't stand that Perl beats PHP, so don't forget: while is forbidden when golfing (for is often shorter but never longer), and to do a newline, just press enter (1 byte instead of 2 for \n)! Here is your (untested) code a bit more golfed (227 bytes), with the newline replaced by ↵: for(;$c=$i=parse_url(trim(fgets(STDIN))),fwrite($f=fsockopen($h=$i[host],80),"GET $i[path] HTTP/1.1↵Host:$h↵Connection:Close↵↵");preg_match_all('!
(.+?)
!sim',$c,$r),print join('↵',$r[1]).'↵')for(;!feof($f);)$c.=fgets($f);

I don't mean "forbidden" as "against the rules", I just mean that's not useful at all, since a for-loop is always better than a while-loop ;).

@Blackhole thanks, this reminded me to change all my line endings to linefeeds only and that PowerShell also accepts embedded line breaks in string literals, so I was able to save 14 bytes on my answer.

@Blackhole Saved at last 9 bytes (\n, for and join). Thanks again.

In you last foreach can't you replace that with echo join($r[1],'↵');? with a newline instead of ↵

@MichaelDibbets Actually I did that already as written in the edit. Hm. Let me see. Haha, I forgot to copy and count the final snippet. Duh :D Things like that happen, if you update your code before breakfast. Thanks for pointing it out.

Why don't you put all the expression but the while one in your first for loop, as I've suggested? This way, you can remove the angular brackets and save 2 bytes. Additionally, you can save 4 bytes by replacing this while loop with while($l=fgets($f))$c.=$l;. And this Connection:Close↵ doesn't seem to be necessary (-17 bytes).

@Blackhole I got it working now, putting everything into the expressions of for. Thanks for those 2 bytes. If I omit Connection:Close it breaks. This was actually one of the first things I tried before publishing the answer.

“If there are no "\n" characters in a subject string, or no occurrences of ^ or $ in a pattern, setting this modifier has no effect.” – Pattern Modifiers, m (PCRE_MULTILINE)

PHP has this nice function called stream_get_contents() which reads until EOF, bit shorter than your while.

@manatwork I wasn't sure whether some content might break if I remove it. It passed all my test cases at last, so thanks for saving 1 byte. :)

@bwoebi Good point. In the beginning I discarded the idea of using file_get_contents (low level and stuff ;) ) - it seems I suppressed stream_get_contents as well that moment. :D It saved 3 bytes, which also led to another 3 bytes I could save. Thanks a lot.

and now save yet another 5 bytes by inlining the variable $c (put the stream_get_contents as arg to preg_match_all()) for(;...;print join("↵",$r[1])."↵"))preg_match_all('!
(.+?)
!si',stream_get_contents($f), $r);

@bwoebi True that - it was way after my bedtime yesterday.

Perl, 132 bytes
155 bytes code + 17 for -ln -MIO::Socket - 40 for continually asking for URLs
As with @DigitalTrauma's answer, regex parsing HTML, let me know if that's not acceptable. Doesn't keep parsing URLs any more... I'll look at that later... Close to Bash though! Big thanks to @Schwern for saving me 59 (!) bytes and to @skmrx for fixing the bug to allow a claim of the bonus!
m|(http://)?([^/]+)(/(\S*))?|;$s=new IO::Socket::INET"$2:80";print$s "GET /$4 HTTP/1.1
Host:$2
Connection:close

";local$/=$,;print<$s>=~m|
(.+?)
|gs

Usage
$perl -ln -MIO::Socket -M5.010 wb.pl
example.com
This domain is established to be used for illustrative examples in documents. You may use this
    domain in examples without prior coordination or asking for permission.More information...
example.org
This domain is established to be used for illustrative examples in documents. You may use this
    domain in examples without prior coordination or asking for permission.More information...

I fixed a bug and shortened the code by removing the need to declare $h and $p or have a default path. It also no longer requires a trailing / on the host.

We're the one to beat now. :)

I think I'm done for the night. :)

Since the script asks for another URL instead of exiting, you can claim an additional -40 bytes

@skmrx I kept getting errors when trying to run repeated URLs to I removed the bonus... Is it working ok for you? I'm getting an error where it apepars $s is undefined on the second run...

@DomHastings oops sorry, it doesn't work for me as well. But I think I found the problem - $/ is set to undef which carries over to the next loop. Setting it to "\n" at the end works :)

@skmrx Aaah of course! Thank you! I'll amend that later on!

So close ;-)  I think using MIO::Socket is perfectly fine.  I don't really know much perl, but I'd be surprised if you can't claim the 40 point bonus to your advantage as well.

@DigitalTrauma you are indeed correct! I've claimed the bonus thanks to skmrx fixing my bug with ‘$/‘ and I wouldn't be near yours if it weren't for Schwern!

PowerShell, 315 294 268 262 254 bytes
355 334 308 302 294 - 40 for prompt
$u=[uri]$args[0]
for(){
$h=$u.Host
$s=[Net.Sockets.TcpClient]::new($h,80).GetStream()
$r=[IO.StreamReader]::new($s)
$w=[IO.StreamWriter]::new($s)
$w.Write("GET $($u.PathAndQuery) HTTP/1.1
HOST: $h

")
$w.Flush()
($r.ReadToEnd()|sls '(?s)(?<=
).+?(?=
)'-a).Matches.Value
[uri]$u=Read-Host
}

Requires PowerShell v5
All line endings (including the ones embedded in the string) are newlines only \n (thanks Blackhole) which is fully supported by PowerShell (but if you're testing, be careful; ISE uses \r\n).

+1 for making my server admin duties appear much more productive

HTTP requires CRLF, not LF! [HTTPSYNTAX]

@toothbrush Ha! Point taken, but the tolerance provision seems to be in full effect. Clearly this task is about what works and not what's correct (otherwise we wouldn't be parsing HTML with regex and using low level TCP libraries instead of well-tested existing libraries).

@briantist https://greenbytes.de/tech/webdav/rfc7230.html#rfc.section.3.5 says that "a recipient MAY recognize a single LF as a line terminator and ignore any preceding CR". I read that as meaning most web servers would implement it, and the question definitely doesn't say it must generate correct GET requests…  :)

Bash (might be cheating but seems to be within rules) 144-40=105
while read a;do
u=${a#*//}
d=${u%%/*}
e=www.w3.org
exec 3<>/dev/tcp/$d/80
echo "GET /services/html2txt?url=$a HTTP/1.1
Host:$d
">&3
cat <&3
done

Thanks to Digital Trauma.
Since I don't need to split URL, this also works: 122-40=82
while read a;do
d=www.w3.org
exec 3<>/dev/tcp/$d/80
echo "GET /services/html2txt?url=$a HTTP/1.1
Host:$d
">&3
cat <&3
done

I would argue that using this online html2txt converter is a standard loophole

Yes. And I also use cat so your solution is safe.

Groovy script, 89, 61 bytes
Loop back for bonus 101- 40 = 61

System.in.eachLine{l->l.toURL().text.findAll(/
(?s)(.*?)<\/p>/).each{println it[3..it.length()-5]}}

With just args, 89 bytes

this.args[0].toURL().text.findAll(/
(?s)(.*?)<\/p>/).each{println it[3..it.length()-5]}

Groovy outgolfed everyone. As it should be.

@quartata If it stays that way, it'll be the first time ever, so... ;)

"only low-level TCP APIs are allowed"

Yeah i'm going to agree with @DigitalTrauma that this isn't using a low-level TCP API. The rules state that you have to split the host and path on your own.

Ruby, 118
147 bytes source; 11 bytes '-lprsocket'; -40 bytes for looping.
*_,h,p=$_.split'/',4
$_=(TCPSocket.new(h,80)<<"GET /#{p} HTTP/1.1
Host:#{h}
Connection:close

").read.gsub(/((\A|<\/p>).*?)?(
|\Z)/mi,'
').strip

Usage example:
$ ruby -lprsocket wb.rb
http://example.org/
This domain is established to be used for illustrative examples in documents. You may use this
    domain in examples without prior coordination or asking for permission.
More information...
http://www.xkcd.com/1596/
Warning: this comic occasionally contains strong language (which may be unsuitable for children), unusual humor (which may be unsuitable for adults), and advanced mathematics (which may be unsuitable for liberal-arts majors).

This work is licensed under a
Creative Commons Attribution-NonCommercial 2.5 License.

This means you're free to copy and share these comics (but not to sell them). More details.

C 512 Bytes
#include <netdb.h>
int main(){char i,S[999],b[99],*p,s=socket(2,1,0),*m[]={"
","
"};long n;
gets(S);p=strchr(S,'/');*p++=0;struct sockaddr_in a={0,2,5<<12};memcpy(&a.
sin_addr,gethostbyname(S)->h_addr,4);connect(s,&a,16);send(s,b,sprintf(b,
"GET /%s HTTP/1.0\r\nHost:%s\r\nAccept:*/*\r\nConnection:close\r\n\r\n",p,S),0);
p=m[i=0];while((n=recv(s,b,98,0))>0)for(char*c=b;cm[i]){if(i)putchar(c[m[i]-p]);p--;}
if(i)putchar(*c);}}}

Based loosely on my entry here,   It takes the web address without a leading "https://".  It will not handle nested
 pairs correctly :(
Tested extensively on www.w3.org/People/Berners-Lee/
It works when compiled with Apple LLVM version 6.1.0 (clang-602.0.53) / Target: x86_64-apple-darwin14.1.1
 It has enough undefined behavior that it may not work anywhere else.

I was going down roughly the same track (this segfaults when compiled with gcc), but it should be possible to get under 400 bytes in C.  Not sure about clang, but you shouldn't have to declare the return type of main.  You can also remove the include and "access" the structs as integer arrays instead.  I've also been getting responses with "GET /%s HTTP/1.1\r\n\r\n", but mileage on that may vary based on the site...

483 bytes

AutoIt, 347 bytes
Func _($0)
$4=StringTrimLeft
$0=$4($0,7)
$3=StringSplit($0,"/")[1]
TCPStartup()
$2=TCPConnect(TCPNameToIP($3),80)
TCPSend($2,'GET /'&$4($0,StringLen($3))&' HTTP/1.1'&@LF&'Host: '&$3&@LF&'Connection: close'&@LF&@LF)
$1=''
Do
$1&=TCPRecv($2,1)
Until @extended
For $5 In StringRegExp($1,"(?s)\Q
\E(.*?)(?=\Q
\E)",3)
ConsoleWrite($5)
Next
EndFunc

Testing
Input:
_('http://www.autoitscript.com')

Output:
You don't have permission to access /error/noindex.html
on this server.

Input:
_('http://www.autoitscript.com/site')

Output:
The document has moved here.

Remarks

Doesn't support nested
 tags
Supports only
 tags (case-insensitive), will break on every other tag format
Panics Loops indefinitely when any error occurs

C#, 727 Bytes - 40 = 687 Bytes
using System.Text.RegularExpressions;class P{static void Main(){a:var i=System.Console.ReadLine();if(i.StartsWith("http://"))i=i.Substring(7);string p="/",h=i;var l=i.IndexOf(p);
if(l>0){h=i.Substring(0,l);p=i.Substring(l,i.Length-l);}var c=new System.Net.Sockets.TcpClient(h,80);var e=System.Text.Encoding.ASCII;var d=e.GetBytes("GET "+p+@" HTTP/1.1
Host: "+h+@"
Connection: close

");var s=c.GetStream();s.Write(d,0,d.Length);byte[]b=new byte[256],o;var m=new System.IO.MemoryStream();while(true){var r=s.Read(b,0,b.Length);if(r<=0){o=m.ToArray();break;}m.Write(b,0,r);}foreach (Match x in new Regex("
(.+?)
",RegexOptions.Singleline).Matches(e.GetString(o)))System.Console.WriteLine(x.Groups[1].Value);goto a;}}

It's a little bit of training but surely memorable :)
Here is an ungolfed version:
using System.Text.RegularExpressions;
class P
{
    static void Main()
    {
    a:
        var input = System.Console.ReadLine();
        if (input.StartsWith("http://")) input = input.Substring(7);
        string path = "/", hostname = input;
        var firstSlashIndex = input.IndexOf(path);
        if (firstSlashIndex > 0)
        {
            hostname = input.Substring(0, firstSlashIndex);
            path = input.Substring(firstSlashIndex, input.Length - firstSlashIndex);
        }
        var tcpClient = new System.Net.Sockets.TcpClient(hostname, 80);
        var asciiEncoding = System.Text.Encoding.ASCII;
        var dataToSend = asciiEncoding.GetBytes("GET " + path + @" HTTP/1.1
Host: " + hostname + @"
Connection: close

");
        var stream = tcpClient.GetStream();
        stream.Write(dataToSend, 0, dataToSend.Length);
        byte[] buff = new byte[256], output;
        var ms = new System.IO.MemoryStream();
        while (true)
        {
            var numberOfBytesRead = stream.Read(buff, 0, buff.Length);
            if (numberOfBytesRead <= 0)
            {
                output = ms.ToArray();
                break;
            }
            ms.Write(buff, 0, numberOfBytesRead);
        }
        foreach (Match match in new Regex("
(.+?)
", RegexOptions.Singleline).Matches(asciiEncoding.GetString(output)))
        {
            System.Console.WriteLine(match.Groups[1].Value);
            goto a;
        }
    }
}

As you can see, there are memory leak issues as a bonus :)

Where is the memory leak? I see no using statements around streams but that does not make a leak.

You can trim a few more bytes: input = input.trimStart("http://") will replace the "if" clause, and you should be able to use System.Text.Encoding.ASCII.GetBytes() directly without having to store it in asciiEncoding first. I think you'd even come out ahead with a "Using System;" line and getting rid of a handful of "System."s.

JavaScript (NodeJS) - 187 166
s=require("net").connect(80,p=process.argv[2],_=>s.write("GET / HTTP/1.0\nHost: "+p+"\n\n")&s.on("data",d=>(d+"").replace(/
([^]+?)<\/p>/g,(_,g)=>console.log(g))));

187:
s=require("net").connect(80,p=process.argv[2],_=>s.write("GET / HTTP/1.1\nHost: "+p+"\nConnection: close\n\n")&s.on("data",d=>(d+"").replace(/
([^]+?)<\/p>/gm,(_,g)=>console.log(g))));

Usage:
node file.js www.example.com

Or formatted
var url = process.argv[2];
s=require("net").connect(80, url ,_=> {
     s.write("GET / HTTP/1.1\nHost: "+url+"\nConnection: close\n\n");
     s.on("data",d=>(d+"").replace(/
([^]+?)<\/p>/gm,(_,g)=>console.log(g)))
});

Caveat: this will work for small pages - bigger pages emit multiple data events.

Python 2 - 212 209 bytes
import socket,re
h,_,d=raw_input().partition('/')
s=socket.create_connection((h,80))
s.sendall('GET /%s HTTP/1.1\nHost:%s\n\n'%(d,h))
p=''
while h:h=s.recv(9);p+=h
for g in re.findall('
(.*?)
',p):print g

You can save two bytes  by stripping out whitespace after the colon on while h: and before print g.

And another byte with 'GET /%s HTTP/1.1\nHost:%s\n\n'.

Python 2, 187 - 40 = 147 (141 in a REPL)
Compressed and looped version of Zac's answer:
import socket,re
while 1:h,_,d=raw_input().partition('/');s=socket.create_connection((h,80));s.sendall('GET /%s HTTP/1.1\nHost:%s\n\n'%(d,h));print re.findall('
(.*?)
',s.recv(9000))

Example:
dictionary.com
['The document has moved here.']
dictionary.reference.com
[]
paragraph.com
[]
rare.com
[]

Actually useful is this:
207 - 40 = 167
import socket,re
while 1:h,_,d=raw_input().partition('/');s=socket.create_connection((h,80));s.sendall('GET /%s HTTP/1.1\nHost:%s\n\n'%(d,h));print'\n'.join(re.findall('
(.*?)
',s.recv(9000),re.DOTALL))

Example:
example.org
This domain is established to be used for illustrative examples in documents. You may use this
    domain in examples without prior coordination or asking for permission.
More information...
www.iana.org/domains/example
The document has moved here.
www.iana.org/domains/reserved

dictionary.com
The document has moved here.
dictionary.reference.com

catb.org

This is catb.org, named after (the) Cathedral and the Bazaar. Most
of it, under directory esr, is my personal site.  In theory other
people could shelter here as well, but this has yet to occur.
catb.org/jargon
The document has moved here.
www.catb.org/jargon/
This page indexes all the WWW resources associated with the Jargon File
and its print version, The New Hacker's Dictionary. It's as
official as anything associated with the Jargon File gets.
On 23 October 2003, the Jargon File achieved the
dubious honor of being cited in the SCO-vs.-IBM lawsuit.  See the FUD entry for details.
www.catb.org/jargon/html/F/FUD.html
 Defined by Gene Amdahl after he left IBM to found his own company:
   “FUD is the fear, uncertainty, and doubt that IBM sales people
   instill in the minds of potential customers who might be considering
   [Amdahl] products.” The idea, of course, was to persuade them to go
   with safe IBM gear rather than with competitors' equipment.  This implicit
   coercion was traditionally accomplished by promising that Good Things would
   happen to people who stuck with IBM, but Dark Shadows loomed over the
   future of competitors' equipment or software.  See
   IBM.  After 1990 the term FUD was associated
   increasingly frequently with Microsoft, and has
   become generalized to refer to any kind of disinformation used as a
   competitive weapon.
[In 2003, SCO sued IBM in an action which, among other things,
   alleged SCO's proprietary control of Linux.  The SCO
   suit rapidly became infamous for the number and magnitude of falsehoods
   alleged in SCO's filings.  In October 2003, SCO's lawyers filed a memorandum
   in which they actually had the temerity to link to the web version of
   this entry in furtherance of their claims. Whilst we
   appreciate the compliment of being treated as an authority, we can return
   it only by observing that SCO has become a nest of liars and thieves
   compared to which IBM at its historic worst looked positively
   angelic. Any judge or law clerk reading this should surf through to
   my collected resources on this
   topic for the appalling details.—ESR]

gawk, 235 - 40 = 195 bytes
{for(print"GET "substr($0,j)" HTTP/1.1\nHost:"h"\n"|&(x="/inet/tcp/0/"(h=substr($0,1,(j=index($0,"/"))-1))"/80");(x|&getline)>0;)w=w RS$0
for(;o=index(w,"
");w=substr(w,c))print substr(w=substr(w,o+3),1,c=index(w,"/p>")-2)
close(x)}

Golfed it down, but this is a more unforgiving version, which needs the web address without http:// at the beginning. And if you want to access the root directory you have to end the address with a /. Furthermore the
 tags have to be lower case.
My earlier version actually didn't handle lines containing

 correctly. This is now fixed.
Output for input example.com/
This domain is established to be used for illustrative examples in documents. You may use this
    domain in examples without prior coordination or asking for permission.
More information...

Still doesn't work with Wikipedia. I think the reason is that Wikipedia uses https for everything. But I don't know.
The following version is a little more forgiving with the input and it can handle upper case tags as well.
IGNORECASE=1{
    s=substr($0,(i=index($0,"//"))?i+2:0)
    x="/inet/tcp/0/"(h=(j=index(s,"/"))?substr(s,1,j-1):s)"/80"
    print"GET "substr(s,j)" HTTP/1.1\nHost:"h"\nConnection:close\n"|&x
    while((x|&getline)>0)w=w RS$0
    for(;o=index(w,"
");w=substr(w,c))
        print substr(w=substr(w,o+3),1,c=index(w,"/p>")-2)
    close(x)
}

I'm not sure about the "Connection:close" line. Doesn't seem to be mandatory. I couldn't find an example that would work different with or without it.

Powershell(4) 240
$input=Read-Host ""
$url=[uri]$input
$dir=$url.LocalPath
Do{
$res=Invoke-WebRequest -URI($url.Host+"/"+$dir) -Method Get
$res.ParsedHtml.getElementsByTagName('p')|foreach-object{write-host $_.innerText}
$dir=Read-Host ""
}While($dir -NE "")

Ungolfed (proxy is not required)
$system_proxyUri=Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings" -Name ProxyServer
$proxy = [System.Net.WebRequest]::GetSystemWebProxy()
$proxyUri = $proxy.GetProxy($system_proxyUri.ProxyServer)
$input = Read-Host "Initial url"
#$input="http://stackoverflow.com/questions/tagged/powershell"
$url=[uri]$input
$dir=$url.LocalPath
Do{
$res=Invoke-WebRequest -URI($url.Host+"/"+$dir) -Method Get -Proxy($proxyUri)
$res.ParsedHtml.getElementsByTagName('p')|foreach-object{write-host $_.innerText}
$dir=Read-Host "next dir"
}While($dir -NE "")

edit* also not to hard to memorize ^^

Java (OpenJDK 15), 790 bytes - 40 bytes = 750 bytes
import java.io.*;import java.net.*;import java.util.*;import java.util.regex.*;interface A{static void main(String[]a)throws IOException{Pattern p=Pattern.compile("
(.*?)
",Pattern.DOTALL);Matcher m;while(true){URL u=new URL(new Scanner(System.in).nextLine());Socket s=new Socket(u.getHost(),80);PrintStream ps=new PrintStream(s.getOutputStream());BufferedReader b=new BufferedReader(new InputStreamReader(s.getInputStream()));ps.print("GET "+(u.getPath().length()==0?"/":u.getPath())+" HTTP/1.1\r\nHost: "+u.getHost()+"\r\nConnection: close\r\n\r\n");var l=b.readLine();var r=new StringBuilder();while(l!=null){l=b.readLine();r.append(l).append("\n");}m=p.matcher(r);while(m.find()){System.out.println(m.group().replaceAll("
|
",""));}ps.close();b.close();s.close();}}}

Ungolfed version:
package rocks.sech1p;

import java.io.*;
import java.net.*;
import java.util.*;
import java.util.regex.*;

public class Main {
    public static void main(String[] args) throws IOException {
        Scanner input = new Scanner(System.in);
        Pattern pattern = Pattern.compile("
(.*?)
", Pattern.DOTALL);
        Matcher match;

        while(true) {
            URL url = new URL(input.nextLine());
            Socket socket = new Socket(url.getHost(), 80);
            PrintStream printstream = new PrintStream(socket.getOutputStream());
            BufferedReader buffer = new BufferedReader(new InputStreamReader(socket.getInputStream()));

            printstream.print("GET " + (url.getPath().length() == 0 ? "/" : url.getPath()) + " HTTP/1.1\r\nHost: " + url.getHost() + "\r\nConnection: close\r\n\r\n");

            String line = buffer.readLine();
            StringBuilder response = new StringBuilder();
            while (line != null) {
                line = buffer.readLine();
                response.append(line).append("\n");
            }
            match = pattern.matcher(response);
            while(match.find())
                System.out.println(match.group().replaceAll("
|
", ""));

            printstream.close();
            buffer.close();
            socket.close();
        }
    }
}

649 bytes

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


text:
Beta's Snowflake
Challenge
Winter is fast approaching with many places receiving the first layers of snow for the 15/16 season, so why don't we break out the snow machines and code ourselves some snow?
Given a integer n via STDIN, output an ASCII representation Beta's snowflake (as described below) at level n.
Beta's Snowflake
The snowflake starts off at level 0 with a single x:
x

Then, on each corner you add one of these shapes:
x
xx

You add the above shape to a top right corner. For a bottom right corner, rotate it 90° clockwise, for bottom left, 180° clockwise and for top left, 270° clockwise.
If you do that, you get the following shape:
 x x
xx xx
  x
xx xx
 x x

Take note of the orientation of the shapes. Carrying on we add more of the shapes to each corner, using the orientation rules described above, to the diagram to get level 2:
  x x x
 xxxxxxx
xx x x xx
 xxx xxx
xx  x  xx
 xxx xxx
xx x x xx
 xxxxxxx
  x x x

Note that the shapes are only added to xs with two or more exposed sides (which is referred to as a corner above).
The L-shapes may and will overlap for values of n greater than 1. For example:
If level 0 is:
x x

Then there must be overlaps in level 1 (indicated with an o, do not include the o in your output):
 x o x
xxxoxxx
  x x
xxxoxxx
 x o x

Your task is to output this ASCII representation of Beta's snowflake.
Bonus
There will be a 50 rep bonus for the shortest program which, when n is negative, outputs the snowflake (at level n*-1) as an image or graphically to the screen.
You may have a separate programs for the bounty and the main task.
Winning
The shortest program in bytes wins.

A gamma snowflake is a 3d version of this.

@CᴏɴᴏʀO'Bʀɪᴇɴ Well that's an idea for a follow up challenge ;)

Can you clarify the 2 or more exposed sides rule?  Assuming center is 0,0 then 1,1,1,-1,-1,-1,-1,1 all have 2 exposed sides (the sides facing towards the other 4 points).  Shouldn't it be 3+ open sides to avoid infilling?  Or alternately it only expands if it has 0 or 1 neighbors (cardinal).

As per above, it would also lead to additional growth in cases like n=2 on the corners of the 'square' around the center (it is not a peak, but it is exposed on the W,NW,N sides (for top left).

CJam, 88 83 82 bytes
1]]{{0f+zW%}8*{YYb_m*{~W$m>fm>}%z:z8Ybff=__1m>\1fm>]:zWf%(\:..|}4*..|}q~*" x"ff=N*

Test it here.
I think I can save a lot in how I detect where the corners are. But at least I finally know what the next iterations look like:
N = 3:
   x x x x
  xxxxxxxxx
 xx x x x xx
xx xxxxxxx xx
 xxx x x xxx
xx xxx xxx xx
 xxx  x  xxx
xx xxx xxx xx
 xxx x x xxx
xx xxxxxxx xx
 xx x x x xx
  xxxxxxxxx
   x x x x

N = 4:
    x x x x x
   xxxxxxxxxxx
  xx x x x x xx
 xx xxxxxxxxx xx
xx xx x x x xx xx
 xxx xxxxxxx xxx
xx xxx x x xxx xx
 xxx xxx xxx xxx
xx xxx  x  xxx xx
 xxx xxx xxx xxx
xx xxx x x xxx xx
 xxx xxxxxxx xxx
xx xx x x x xx xx
 xx xxxxxxxxx xx
  xx x x x x xx
   xxxxxxxxxxx
    x x x x x

Looking at these, they seem to be a lot more regular than I expected, and some sort of analytic solution which generates them directly might be much shorter.

Python 2, 269 bytes
Doesn't place the shapes at each corner, but determines whether a character is in the snowflake based on the coordinates.
First one corner is generated, and then mirrored around to the full snowflake.
i=input()
d=2*i+1
s=[x[:]for x in[[0]*d]*d]
s[0][0]=1
if i:s[1][1]=1
for j in range(2,d):
 for v in range(j+1):s[j][v]=s[v][j]=(j+v)%3!=1and j+v<d+i if v>j/2 else j%2==1or j%4+v%2in[0,3]
for l in[l[:0:-1]+l for l in s[:0:-1]+s]:print''.join(['X'if n else' 'for n in l])

source: Stack Exchange

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

sort: votes


text:
The obstacle course
The obstacle course
You are currently stuck in some kind of course and you have to escape. However, if you do not choose the fastest way then the exit will close in front of you. Your challenge is to find the fastest route in an obstacle course.
Input
Your input consists of a list with lists in it, a 2D grid containing only positive integers. For example, it might look as follows:
eg. [[0,1,2],[0,3,5],[2,6,1]] which visually looks like:
0  1  2
0  3  5
2  6  1

Each number represents the time that is needed to pass the location. For example, (1,2) takes 6 seconds to pass. Your code can take for granted that no conversions of the input have to be made to make it a list that works with your language.
Computing
Your starting position will also be (1,1), which in the input above is 2. You have to include those seconds in your final answer. From your starting position your goal is to work to (xmax, ymax), which in the input above is (3,3). You have to find the fastest route to get there, so the sum of your numbers must be minimal.
Note for example understanding: the grid is from 1 and on-wards, (0,0) is not the starting position. (1,1) is bottom left and (3,3) is top right in this example.
Output
Your code must output the minimal time it takes to reach the top right corner from the bottom left corner. In the input above this is 2 +  0 + 0 + 1 + 2 = 5 seconds. Your code should output nothing else than a whole integer.
Additional specifications

Your may not move diagonally; only left, right, down, up
This is code-golf, shortest code in bytes wins
The grid wont always be square, but the start will always be connected to the end
minimum input is a 1x1 grid
grid will only contain positive integers

To sum up the given example:
Input: [[0,1,2],[0,3,5],[2,6,1]] // any format you like
Output: 5

How:
2 + 0 + 0 + 1 + 2 = 5

Will the 2D grid be square?

What's the minimum input size? 1x1?

If the bottom left corner is (1,1), wouldn't the top right corner be (3,3) in your example?

Edited. I wrote the question from mobile so the grid was weird.

Are all times nonnnegative?

Yes, good question though.

Matlab, 207 199 bytes
Given the matrix with all the times A, the idea is using a new B matrix that has every entry set to Inf except the initial entry. Then we generate a new matrix C where we apply following formula to each pair of coordinates (i,j)
 C(i,j) = min( B(i,j), B(i-1,j)+A(i,j), B(i+1,j)+A(i,j), B(i,j-1)+A(i,j), B(i,j+1)+A(i,j) );

This means: either B(i,j) already represents the minimum time to get to (i,j) or we can get to B(i,j) quicker via one of the neighbours.
Then we replace B with C and repeat this step enough times (until nothing changes anymore), and #rows + #columns is an upper bound for this.
After that, we just need to print the top right element (or in matrix-speak: bottom right) element.
This idea is basically stolen from the Floyd-Warshall algorithm.
Note that for doing this, I need also to consider some technical details, namely that I should not access elements outside the matrix, that is why I need the zero padding and shift of coordinates.
a=input('');
[r,c]=size(a);
A=padarray(a,[1,1]);
C=A+Inf;C(2,2)=A(2,2);
for i=1:r+c
    B=C;
    for i=2:r+1;
        for j=2:c+1;
            v=[-1,1];
            C(i,j)=min([B(i,j)-A(i,j),B(i+v,j)',B(i,j+v)]+A(i,j));
        end;
    end;
end;
disp(A(r+1,c+1))

Input: We need to reverse the order of the rows due to indexing, so the example given would be
[[2,6,1];[0,3,5];[0,1,2]]

or alternatively
[2,6,1;0,3,5;0,1,2]

So for this example we get following intermediate steps that will show the progression quite nicely (I removed the padding):
 2     Inf   Inf
 Inf   Inf   Inf
 Inf   Inf   Inf

 2     8     Inf
 2     Inf   Inf
 Inf   Inf   Inf

 2     8     9
 2     5     Inf
 2     Inf   Inf

 2     8     9
 2     5    10
 2     3    Inf

 2     8     9
 2     5    10
 2     3     5

PS: I love challenges like this one=)

Glad you liked it. Not glad to see that this is the only answer :(

Perhaps you might want to first post it in the sandbox or/and discuss it with some guys in the chat. I think the challenge was great, but perhaps people just stopped by once and saw that there were still some things to figure out. But sometimes challenges you put a lot of effort  in still do not get answered a lot. I just recently had one of those here.

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


text:
Monday Mini-Golf #6: Meeesesessess upp teeexexextext
Monday Mini-Golf: A series of short code-golf challenges, posted (hopefully!) every Monday.
True story1: The other day, I was playing around on my tablet when I had the idea to visit the page I normally use on my PC for testing JavaScript. After the page loaded, I entered this simple program:
alert("Hello!")

I then proceeded to press the Execute button, and was surprised when it told me that the code I had entered was invalid. I took a second look at the textbox and saw this:
alllelelerlerlertlert("Heeelelellellelloello!")

Wha??? That's not what I entered! So what happened here? To figure it out, I entered two simple lines:
abcdefg
0123456

This turned out as:
abbbcbcbcdbcdbcdebcdebcdefbcdefbcdefgbcdefg
0112123123412345123456

By now, I still had no clue about what happened to letters, but the numbers seemed simpler, so I took a closer look. As it turned out, the webpage was simply entering the first character, then repeating all the rest in the string every time a new one was pressed:
0112123123412345123456
0
 1
  12
    123
       1234
           12345
                123456

But what about the sections of letters? After pondering for a minute, I realized that it's just the same, but instead of repeating each subsection once, it repeats it twice:
abbbcbcbcdbcdbcdebcdebcdefbcdefbcdefgbcdefg
a
 bb
   bcbc
       bcdbcd
             bcdebcde
                     bcdefbcdef
                               bcdefgbcdefg

A combination of the two works with a combination of these techniques:
abc123z
abbbcbcbc1bc12bc123bc123zbc123z
a
 bb
   bcbc
       bc1
          bc12
              bc123
                   bc123zbc123z

Whatever glitch causes this seems to reset at punctuation and spaces, so abc def becomes abbbcbc deeefef.
By this point, I was so absorbed in figuring it out and turning it into an interesting challenge that I forgot why I had been on there in the first place. (I did figure out how to type normally, however: pressing space-backspace after every character. Pretty tedious, but you gotta do what you gotta do.)
Challenge
The goal of the challenge is to write a program or function that takes in the text to be processed, makes the changes listed above, and outputs/returns the result.
Details

The input will only contain printable ASCII, and no tabs or newlines.

Test-cases
Inputs: (one per line)
Mess up text
This is some longer text.
CAPS LOCK && "Punc-tua"+'tion'
under_score_style
CaPs wItHIn loWERs
1337 numb3r5
abcdefghij 0123456789
Code-golf is the best!

Outputs:
Meeesesessess upp teeexexextext
Thhhihihishis iss sooomomomeome looononongongongeongeongeronger teeexexextext.
CAAAPAPAPSAPS LOOOCOCOCKOCK && "Puuunununcunc-tuuuaua"+'tiiioioionion'
unnndndndendendernder_scccococorcorcorecore_stttytytyltyltyletyle
CaaaPaPaPsaPs wIIItItItHItHItHIItHIItHInItHIn loooWoWoWEoWEoWERoWERoWERsoWERs
1333337 nuuumumumbumbumb3umb3rumb3rumb3r5
abbbcbcbcdbcdbcdebcdebcdefbcdefbcdefgbcdefgbcdefghbcdefghbcdefghibcdefghibcdefghijbcdefghij 0112123123412345123456123456712345678123456789
Cooodododeode-gooolololfolf iss thhhehe beeesesestest!

Scoring
This is code-golf, so shortest valid code in bytes wins. Tiebreaker goes to submission that reached its final byte count first. The winner will be chosen next Monday, Nov 2. Good luck!
Edit: And the winner is... @MartinBüttner using Retina for an incredible 43-byte solution!
1 Yes, this story is completely true, and if you need any more clarification, see footnote 1.

That punctuation rule... ' '.join(x[0]+''.join(2*x[1:i]for i in range(1,len(x)+1)) for x in raw_input().split())

cough Use the Chrome DevTools cough

@TheDoctor Check out my answer's edit history :P

@BetaDecay great minds think alike ;)

inb4 someone makes a language where you actually have to type like this.

Retina, 43 bytes
.(?<=[^_\W]([^_\W]+))(?<=(\1)(?<=\D))?
$1$2

Run the code from a single file with the -s flag. Since this is just a single regex substitution, you can test it here (click the Context tab to see the results).
Explanation
This matches any digit and letter which is not the first in a run. While . can match any non-linefeed character, the lookbehinds ensure the other conditions:
(?<=[^_\W]([^_\W]+))

This matches backwards from the position after the .. First it matches one or more alphanumeric characters and captures them into group 1 with ([^_\W]+). This immediately ensures that the . corresponds to an alphanumeric character itself. Then the additional [^_\W] makes sure that there is one more alphanumeric character in the current run, which we don't include the match. Now group 1 is what we want to replace the match with if it is a digit - if it is a letter we want to replace it with twice this string. That's where the second lookbehind comes into play:
(?<=(\1)(?<=\D))?

This one is optional, so if it fails it won't affect the match at all. It first ensures that the . was not a digit via (?<=\D) - so this lookbehind is only relevant when we're matching letters. In that case, we match group \1 once more (this always matches, because we've captured the group from the same position), but capture it into group 2.
Hence, we simply replace the regex with the contents of both groups ($1$2). If the match was a digit, $2 will still be empty and we write back the prefix only once. If it was a letter, $2 is the same as $1 and we write it back twice.

JavaScript(ES6) 82
Using the regexp optimization suggested by Mwr247
s=>s.replace(/([\W_])|./g,(x,y)=>y?(f=0,x):f?(p+=x,p+(-x-1?z:p)):(p=z,f=x),f=z='')

Test running the snippet below in any recent browser

F=s=>s.replace(/([\W_])|./g,(x,y)=>y?(f=0,x):f?(p+=x,p+(-x-1?z:p)):(p=z,f=x),f=z='')

// document.write(F(prompt('Insert string')))

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

function test()
{
  O.innerHTML=F(I.value)
}

;[
 ['Mess up text','Meeesesessess upp teeexexextext']
,['This is some longer text.',
  'Thhhihihishis iss sooomomomeome looononongongongeongeongeronger teeexexextext.']
,['CAPS LOCK && "Punc-tua"+\'tion\'',
  'CAAAPAPAPSAPS LOOOCOCOCKOCK && "Puuunununcunc-tuuuaua"+\'tiiioioionion\'']
,['CaPs wItHIn loWERs'
  ,'CaaaPaPaPsaPs wIIItItItHItHItHIItHIItHInItHIn loooWoWoWEoWEoWERoWERoWERsoWERs']
,['1337 numb3r5','1333337 nuuumumumbumbumb3umb3rumb3rumb3r5']
,['abcdefghij 0123456789'
 ,'abbbcbcbcdbcdbcdebcdebcdefbcdefbcdefgbcdefgbcdefghbcdefghbcdefghibcdefghibcdefghijbcdefghij 0112123123412345123456123456712345678123456789']
,['Code-golf is the best!'
  ,'Cooodododeode-gooolololfolf iss thhhehe beeesesestest!']
].forEach(t => (
  i=t[0],x=t[1],r=F(i),
  console.log('Test ' + (r==x?'OK':'Fail')+'\nInput:  '+i+'\nResult: '+r+'\nCheck:  '+x+'\n')
))
#I { width: 50% }
Your test<input id=I><button onclick="test()">-></button>

Holy cow! That's way different (and better) than I would have done it (similar to n̴̖̋h̷͉̃a̷̭̿h̸̡̅ẗ̵̨́d̷̰̀ĥ̷̳'s approach). +1

JavaScript (ES6), 92 88 87
f=>f.replace(/[^_\W]+/g,m=>m[0]+[...m].slice(1).reduce((a,e)=>a+=(y+=e,++e?y:y+y),y=''))

I have no idea how to golf this down...
Thanks Mwir247 for the golfed down regex and ETHproductions for one byte golf in reduce function.

Use this for your regex: /[^_\W]+/g (saves 3 characters)

I believe this would work for the .reduce function: (a,e)=>a+=(y+=e,++e?y:y+y) (1 byte shorter)

Haskell, 215 200 bytes
import Data.List
import Data.Char
c=concatMap
p c=[isDigit c,isAlpha c]
r(Just n)=c id.replicate(n+1)
r _=id
f(h:t)=h:(c(\s->r(findIndex id.p$last s)s).tail.inits)t
m=c f.groupBy(\a b->or$p a==or$p b)

It's a mess.
Have fun reading all the weird quirks, I never thought I would use id this much.
Too bad the stuff that already does half the work here needs to be imported (isDigit,isAlpha,inits).

It's lang-hs not lang-haskell.  By specifying lang-haskell it probably ends up using a default highlighter.

Gema, 57 characters
\X?=?@set{s;}
<D1>=@append{s;$0}$s
<L1>=@append{s;$0}$s$s

Sample run:
bash-4.3$ gema '\X?=?@set{s;};<D1>=@append{s;$0}$s;<L1>=@append{s;$0}$s$s' <<< '1337 numb3r5'
1333337 nuuumumumbumbumb3umb3rumb3rumb3r5

Haskell, 183 181 bytes
import Data.Char
b(x:y)|h x=x:c[]y|2>1=x:b y
b[]=[]
h y=isDigit y||isAlpha y
c x l@(y:z)|h y=c(y:x)z|2>1=c x[]++b l
c x[]=reverse$g$x
g[]=[]
g a@(x:y)|isDigit x=a++g y|2>1=a++a++g y

Usage:
b"Hello, world!"
>"Heeelelellellelloello, wooorororlorlorldorld!"

Don't know if it is essentially different with Leif Willerts' answer. But here's the algorithm.

Search for valid letter(Letter or Num)
If it letter, begin collecting letter. However, it is stored reversely, make the string reversed. And first item is omitted.
As it hit invalid letter, do the question's transform with reversed input. The question's transform is reverse.g.reverse, but since it is already reversed, then we just do reverse.g

I somehow keep redudant brackets.

Python 2, 131 Bytes
i=raw_input();s=r='';g=1
for c in i:
 s+=c
 if g:r+=c;g=0;s=''
 elif c.isalpha():r+=s*2
 elif '/'<c<':':r+=s
 else:g=1;r+=c
print r

Loops through characters, and saves/repeats if required.

T-SQL, 357 bytes
create proc x(@s varchar(99),@z int=0,@i int=0,@y varchar(99)='',@x varchar(99)='',@w varchar(99)='') as

while LEN(@s)>0
begin
    select @z=patindex('%[^0-z]%',@s+' '),@i=1,@w+=LEFT(@s,1)
    while @i<@z-1
    begin
        select @y=SUBSTRING(@s,2,@i)
        ,@x+=@y
        ,@i+=1
        if @y like'%[a-z]'set @x+=@y
    end
select @w+=@x+SUBSTRING(@s,@z,1)
        ,@x=''
        ,@s=REPLACE(@s,left(@s,@z),'')
end

select @w

ex:
exec x(@s='1337 numb3r5')
returns 1333337 nuuumumumbumbumb3umb3rumb3rumb3r5

Pip, 41 bytes
aR`[^_\W]+`{Y0a@0.Ya@{1,++y}X2-(_Q+_)MJa}

Takes the text as a command-line argument. We use a regex replacement to replace all alphanumeric runs ([^_\W]+) with a callback function. This function maps another function to each character of the word, generating progressively larger runs of characters (with the global variable y keeping track of the index) and repeating them X2 if the character is not a number. (The logic for which uses + to convert to a number and then Q to check whether this is string-equal to the original character.) This process leaves out the first character, though, so we have to add it on afterward (a@0.).

Python 3, 86 bytes
f=0
m=''
for i in input():g=i.isalnum();m=m*g*f+i*f;print(end=m*-~i.isalpha()or i);f=g

Try it online!


text:
The jQuery showdown
Some time after this incident…
There are some of us who are against this defiling order of jQuery. It is an unholy presence, of which must be exterminated. I therefore call on you, the loyal to The New Kingdom of Reformation, to create a program that will eliminate such resistance. All code must be validated and searched for ANY and EVERY trace of jQuery. And, of course, your submission needs to be short (there has been another budget cut, and, unfortunately, it was in the storage department). And it cannot have defiling characters.
To get you up to speed, a defiling character is any of the following characters: jJqQuUeErRyY$x0. As has been said, the use of these characters is strictly prohibited, even in your own program. So don't use them. ALSO we're okay with dollar signs in numbers. So, anything of the form n+(.nn)*$ is O.K. (You still shouldn't use 0.)
Your program/code/etc. must validate an input program. If it contains any defiling characters, you must output This programmer is guilty of Heresy. He must be burnt.; if no such characters are found, you must output Program validated. Clearance level 2 given..
Bonuses and Penalties

I personally admire the character the character ~. For every two you use, I'll give you -1 byte. (i.e., every other ~ is free.)
You may choose precisely one character from the excluded; you may then use this character in all of it's cases, HOWEVER: there is a +50% byte initial penalty, and then a +5 byte penalty for every instance of that character.
-90% if you do not use any of the characters adjacent to jquery (just to be super safe) in your source code. These are (in addition): iIkKpPsSzZXdDfF
-20% if, when given an invalid string, along with outputting the aforementioned text, you replace all invalid characters with - for a run of 1, * with a run less than 10, and [] with any longer run.
-50 bytes if you do not find JavaScript/i or Simplex as having defiling characters.

Reference Implementation

function validate() {
  var str = document.getElementById("input").value;
  var str2 = str.replace(/[jquery0]/gi,"").replace(/x/g,"").replace(/(\d+\.*\d*\d*\$)|\$/g,"$1"); // thanks Doorknob!
  var val;
  if (str2 == str) {
    val = "Program validated. Clearance level 2 given.";
  } else {
    val = "This programmer is guilty of Heresy. He must be burnt.";
  }
  document.getElementById("output").value = val;
}
textarea{width: 600px;}
<textarea id="input" onkeyup="validate()"></textarea>

<textarea id="output" disabled></textarea>

The Ee restriction will be tough...

Your allowed use of $ looks like a regex, i.e. match must be found at end of line. Is this intentional? And since the snippet is not yet fully working, can you give us some pass/fail test-cases?

@ETHproductions No, I mean the character literal. And yes, some cases are on their way ;)

Wait... the output sentences contain defiling letters - HYPOCRISY!!!

@molarmanful It is only the programs that cannot contain these evil letters. We mean not to impede the speech of men towards others, rather, impede the use of characters which have been classified as detrimental to the holy quality of programming. Those who are blind cannot see, those who are deaf cannot speak. Those who use jQuery cannot be tolerated.

-1 not enough jQuery

For reference, how is the second bonus calculated? If my program is 100 bytes, but I rebelliously have included 2 es, is my score (100 + 10) * 150% = 165 or 100 * 150% + 10 = 160?

@FryAmTheEggman You add first, then multiply. It makes the score larger.

My only problem with jQuery is that it is impossible to learn.

Also, I am quite sure that this challenge is impossible with Mma. Even with Names, I would still need to use either Symbol or ToExpression.

Your example is defiled and must be burned.

@LegionMammal978 You can use, under a penalty, any of the defiled characters, for reasons described above.

Just so you know, .replace(/[jJqQuUeErRyY0x]/g,"") is shorter than .replace(/[jquery0]/gi,"").replace(/x/g,"") ;)

@ETHproductions Thanks. Thankfully, mine wasn't a code golf.

Ironically, the $ exception would also break alternative frameworks like AngularJS because it uses $ internally to denote 'official' services and $$ to denote 'private' fields.

Is there a max input string length?

-1 for continually editing the challenge bonuses.

@TimmyD Well then. It hasn't been a problem until now. (I've edited bonuses ~4 times. Thanks for telling me when I started.)

I know, but to do it, I would need multiple defiled characters.

n+(.nn)*$ looks like 123.45.67$ would be accepted, that's weird do you mean /[1-9]+(.[1-9]{2,})?$/

@CamdenNarzt yeah. n is a nonzero digit, and replace the * with a ?.

CJam, 160 139 13.4 bytes
0000000: 22 cf 97 d9 87 d1 85 82 89 8d d1 db 8d 80 a8 af b3 a3  ".................
0000012: b0 b7 82 8e 80 bd c3 ca 89 85 d6 89 84 80 b2 c6 c7 d1  ..................
0000024: 7e ce d0 cd c5 d0 bf cb cb c3 d0 7e c7 d1 7e c5 d3 c7  ~..........~..~...
0000036: ca d2 d7 7e cd c4 7e a6 c3 d0 c3 d1 d7 8c 7e a6 c3 7e  ...~..~.......~..~
0000048: cb d3 d1 d2 7e c0 c3 7e c0 d3 d0 cc d2 8c 80 80 ae d0  ....~..~..........
000005a: cd c5 d0 bf cb 7e d4 bf ca c7 c2 bf d2 c3 c2 8c 7e a1  .....~..........~.
000006c: ca c3 bf d0 bf cc c1 c3 7e ca c3 d4 c3 ca 7e 90 7e c5  ........~.....~.~.
000007e: c7 d4 c3 cc 8c 80 9d 22 7b 39 33 7e 2b 7d 25 7e        ......."{93~+}%~

The above is a hexdump that can be reversed with xxd -r -c 18. Try it online.
The code itself consists of 142 bytes. It contains a total of sixteen ~ characters (-8 bytes), but no jQuery-adjacent characters (-90%).
How it works
The match n+(.nn)*$ really boils down to a digit followed by a dollar sign.
First of all,
"<bunch of characters>"{93~+}%~

adds -94 to all code points of that string and evaluates the result.
The executed code is:
q       e# Read all input from STDIN.
9{      e# For each I in [0 ... 8]:
  )s    e#   Increment and cast to string.
  '$+   e#   Append a dollar sign.
  /s    e#   Split the input at occurrences. Flatten the result.
}/

"JQUERY$0"

_el+'x+ e# Append a lowercase copy and "x" to that string.
&       e# Intersect with the modified input.

"This programmer is guilty of Heresy. He must be burnt."
"Program validated. Clearance level 2 given."

?       e# Ternary if; select the corresponding message.

That's good. Wow.

Good job. Sorry for the grief of bonuses. Didn't realize it would have a detrimental effect on you et all

Minkolang 0.9, 346-3 = 343 bytes
Longest program yet.
#66*68*d5*2:88*5+d5+d7+d1+d3+d4+6[3i+c48*+]2c"N"11-p(od4&k13w35*[dic=,5&kk11w] )
 725*35*48*68*3+5[66+c2~g2p]27*48*1-d2+d6+d8+5[9c2~g2p]37*67*d8+3[67+c2~g2p]55*57*2[77+c2~g2p]X11-2w
"This p og amm   is g ilt  of H   s . H  m st b  b  nt."(O).
 X2546*3[66+c2~g4p]44*d6+47*d3+d2+d8+6[9c2~g4p]X11-4w
"P og am validat d. Cl a anc  l v l 2 giv n."(O).

Try it here.
Explanation
The first line does three things: 1) build up the stack with the forbidden characters, 2) put a much-needed x in the right place (the space at the end), and 3) loop through the input, jumping to the appropriate line.
The second and fourth lines do the same thing: replace every gap in the succeeding line with the appropriate character. They jump to the next line at the end.
The third and fifth lines simply push the required string on the stack and print it out.

Cooooooooooool!

PHP, (204*1.5 + 5) * .1 = 31.1
<?=eval(~šœ—.ß..š˜ ’ž‹œ—×ØÐ¤•ŽŠš.†££Û‡Ï¢Ð–ØÓ..š˜ .š.“žœš×ØÐ¤ÎÒÆ¢Ô×££Ñ¤ÎÒÆ¢„Í‚ÖÀ££ÛÐØÓÝÝÓÛž.˜‰¤Î¢ÖÖÀØ«—–Œß...˜.ž’’š.ß–Œß˜Š–“‹†ß.™ß·š.šŒ†Ñß·šß’ŠŒ‹ß.šß.Š.‘‹ÑØÅØ¯..˜.ž’ß‰ž“–›ž‹š›Ñß¼“šž.ž‘œšß“š‰š“ßÍß˜–‰š‘ÑØÄ);

This dump was made using gnuwin32 hexdump. Reverse with hex2bin.
00000000: 3C 3F 3D 65 76 61 6C 28 - 7E 9A 9C 97 90 DF 8F 8D |<?=eval(~       |
00000010: 9A 98 A0 92 9E 8B 9C 97 - D7 D8 D0 A4 95 8E 8A 9A |                |
00000020: 8D 86 A3 A3 DB 87 CF A2 - D0 96 D8 D3 8F 8D 9A 98 |                |
00000030: A0 8D 9A 8F 93 9E 9C 9A - D7 D8 D0 A4 CE D2 C6 A2 |                |
00000040: D4 D7 A3 A3 D1 A4 CE D2 - C6 A2 84 CD 82 D6 C0 A3 |                |
00000050: A3 DB D0 D8 D3 DD DD D3 - DB 9E 8D 98 89 A4 CE A2 |                |
00000060: D6 D6 C0 D8 AB 97 96 8C - DF 8F 8D 90 98 8D 9E 92 |                |
00000070: 92 9A 8D DF 96 8C DF 98 - 8A 96 93 8B 86 DF 90 99 |                |
00000080: DF B7 9A 8D 9A 8C 86 D1 - DF B7 9A DF 92 8A 8C 8B |                |
00000090: DF 9D 9A DF 9D 8A 8D 91 - 8B D1 D8 C5 D8 AF 8D 90 |                |
000000a0: 98 8D 9E 92 DF 89 9E 93 - 96 9B 9E 8B 9A 9B D1 DF |                |
000000b0: BC 93 9A 9E 8D 9E 91 9C - 9A DF 93 9A 89 9A 93 DF |                |
000000c0: CD DF 98 96 89 9A 91 D1 - D8 C4 29 3B             |          );|
000000cc;

(I'm confused about the order in which to apply the bonus/penalty, so I assumed order as written.)
Uses the character "e" in eval. Thanks to PHP string inversion magic, this manages to avoid all the other jquery and near-jquery characters.
The inverted string contains this code (formatted for clarity)
echo preg_match('/[jquery\\$x0]/i',
  preg_replace('/[1-9]+(\\.[1-9]{2})?\\$/',"", $argv[1]))
  ? 'This programmer is guilty of Heresy. He must be burnt.'
  : 'Program validated. Clearance level 2 given.';

Since this code doesn't have a return statement, eval returns null so <?=eval doesn't do anything. (It's just to avoid <?php)

I think you can simplify it a bit with [jquery$x0] and [1-9]+(\.[1-9]{2})?\$. By the way, capital X should not be considered defiling character, so the second regex should be changed to '/[1-9]+(\.[1-9]{2})?\$|X/'.

Add first, then multiply. Actual score:31.35

><>, 184 bytes
"/6VO+K;[.N'G|(p
~<.1+f9o*-21-*5-1' ';!?l<"K),4):.{%:/27:'67m{X/6:):-86{/6%6/{i{42%6-m"
f +1.>"m'-)&9{69{'(&.{6S{m"'"(6)6S{5,{"'"'/2&4{(2{)6..:)4,)+{(23G"8
!^ag?/i:1+?
p>l?!^1' '5*@@-a

This can be a bit shorter with unprintables, but here's a printable version just for fun. Won't work with the online interpreter since it does puts outside of the codebox.
This program encodes both strings as
G32({+),4):..6){2({4&2/'"{,5{S6)6("m{S6{.&('{96{9&)-'m
K),4):.{%:/27:'67m{X/6:):-86{/6%6/{i{42%6-m

which is each code point subtracted from 155. Similarly,
6V/O+K;[.N'G|(p

encodes the forbidden characters, with code points subtracted from 160.
The last line merely sets the coordinates (forbidden char, 10) to 1, forming a lookup table. The fourth line then checks each input char using the lookup table, outputting the heresy message if 1 else continuing on. On EOF, we move up to output the clearance message.

"Javascript" 840*2+14*5=1750 ;)
I'm soooo close, just need to find a way to get rid of the r's
Stack isn't letting me paste the code in here as there are several non printing ASCII characters in the strings, so here's a hexdump from xxd
0000000: 6576 616c 2868 3d27 272c 643d 5b7b 613a  eval(h='',d=[{a:
0000010: 5b2e 2e2e 2770 5b6c 1a6d 375e 695d 6f67  [...'p[l.m7^i]og
0000020: 5f68 6e28 5d6c 5f5b 6e5f 3f66 5f67 5f68  _hn(]l_[n_?f_g_h
0000030: 6e22 1c6d 5d6c 6327 5d2c 623a 367d 2c7b  n".m]lc'],b:6},{
0000040: 613a 5b27 7e27 5d2c 623a 2d31 347d 2c7b  a:['~'],b:-14},{
0000050: 613a 5b2e 2e2e 276e 1c23 356d 286d 6c5d  a:[...'n.#5m(ml]
0000060: 371c 2929 5d69 5e5f 2864 6b6f 5f6c 7328  7.))]i^_(dko_ls(
0000070: 5d69 6729 646b 6f5f 6c73 5c27 2c28 2b28  ]ig)dko_ls\',(+(
0000080: 2e28 646d 1c26 5e69 5d6f 675f 686e 285c  .(dm.&^i]og_hn(\
0000090: 5c69 5e73 285b 275d 2c62 3a36 7d2c 7b61  \i^s(['],b:6},{a
00000a0: 3a5b 277e 272c 277e 275d 2c62 3a2d 3134  :['~','~'],b:-14
00000b0: 7d2c 7b61 3a5b 2e2e 2e27 5f68 5e3d 6263  },{a:[...'_h^=bc
00000c0: 665e 226d 2326 1e22 1c1d 696f 6e1c 2328  f^"m#&."..ion.#(
00000d0: 705b 6622 686f 6666 1b37 1e22 1c1d 6368  p[f"hoff.7."..ch
00000e0: 1c23 2870 5b66 2223 286d 275d 2c62 3a36  .#(p[f"#(m'],b:6
00000f0: 7d2c 7b61 3a5b 277e 275d 2c62 3a2d 3134  },{a:['~'],b:-14
0000100: 7d2c 7b61 3a5b 2e2e 2e27 6663 6e22 1c1c  },{a:[...'fcn"..
0000110: 2328 6c5f 705f 6c6d 5f22 2328 6469 6368  #(l_p_lm_"#(dich
0000120: 221c 1c23 2867 5b6e 5d62 2229 275d 2c62  "..#(g[n]b")'],b
0000130: 3a36 7d2c 7b61 3a5b 277e 275d 2c62 3a2d  :6},{a:['~'],b:-
0000140: 3335 7d2c 7b61 3a5b 2e2e 2e27 6444 6b4b  35},{a:[...'dDkK
0000150: 6f4f 5f3f 6c4c 7353 1e2a 7257 7656 1e22  oO_?lLsS.*rWvV."
0000160: 391b 2227 5d2c 623a 367d 2c7b 613a 5b2e  9."'],b:6},{a:[.
0000170: 2e2e 275b 312d 395d 5b31 2d39 5d5c 5c2e  ..'[1-9][1-9]\\.
0000180: 293f 5b27 5d2c 623a 312d 317d 2c7b 613a  )?['],b:1-1},{a:
0000190: 5b2e 2e2e 272b 5c27 3357 2329 6123 391c  [...'+\'3W#)a#9.
00001a0: 275d 2c62 3a36 7d2c 7b61 3a5b 277e 275d  '],b:6},{a:['~']
00001b0: 2c62 3a2d 3436 7d2c 7b61 3a5b 2e2e 2e27  ,b:-46},{a:[...'
00001c0: 6c69 616c 5b67 1a70 5b66 635e 5b6e 5f5e  lial[g.p[fc^[n_^
00001d0: 281a 3d66 5f5b 6c5b 685d 5f1a 665f 705f  (.=f_[l[h]_.f_p_
00001e0: 661a 2c1a 6163 705f 6828 1c34 1c4e 6263  f.,.acp_h(.4.Nbc
00001f0: 6d1a 275d 2c62 3a36 7d2c 7b61 3a5b 277e  m.'],b:6},{a:['~
0000200: 275d 2c62 3a2d 3134 7d2c 7b61 3a5b 2e2e  '],b:-14},{a:[..
0000210: 2e27 6c69 616c 5b67 675f 6c1a 636d 1a61  .'lial[gg_l.cm.a
0000220: 6f63 666e 731a 6960 1a42 5f6c 5f6d 7328  ocfns.i`.B_l_ms(
0000230: 1a42 5f1a 676f 6d6e 1a5c 5c5f 1a5c 5c6f  .B_.gomn.\\_.\\o
0000240: 6c68 6e28 1c23 275d 2c62 3a36 7d5d 2e6d  lhn(.#'],b:6}].m
0000250: 6170 2864 3d3e 2876 3d27 272c 773d 642e  ap(d=>(v='',w=d.
0000260: 612e 6d61 7028 633d 3e53 7472 696e 672e  a.map(c=>String.
0000270: 6672 6f6d 4368 6172 436f 6465 2863 2e63  fromCharCode(c.c
0000280: 6861 7243 6f64 6541 7428 292b 642e 6229  harCodeAt()+d.b)
0000290: 292c 772e 666f 7245 6163 6828 287a 2c69  ),w.forEach((z,i
00002a0: 2c61 293d 3e7b 6966 2869 2532 2976 3d76  ,a)=>{if(i%2)v=v
00002b0: 2e63 6f6e 6361 7428 615b 692d 315d 2e63  .concat(a[i-1].c
00002c0: 6f6e 6361 7428 7a29 297d 292c 762e 636f  oncat(z))}),v.co
00002d0: 6e63 6174 2877 2e6c 656e 6774 6825 323f  ncat(w.length%2?
00002e0: 772e 706f 7028 293a 2727 2929 292c 642e  w.pop():''))),d.
00002f0: 666f 7245 6163 6828 287a 2c69 2c61 293d  forEach((z,i,a)=
0000300: 3e7b 6966 2869 2532 2968 3d68 2e63 6f6e  >{if(i%2)h=h.con
0000310: 6361 7428 615b 692d 315d 2e63 6f6e 6361  cat(a[i-1].conca
0000320: 7428 7a29 297d 292c 682e 636f 6e63 6174  t(z))}),h.concat
0000330: 2864 2e6c 656e 6774 6825 323f 642e 706f  (d.length%2?d.po
0000340: 7028 293a 2727 2929 0a                   p():'')).

It is customary to include a byte count in your header ;)

authors: n̴̖̋h̷͉̃a̷̭̿h̸̡̅ẗ̵̨́d̷̰̀ĥ̷̳


text:
Code the Huffman!
Or else he will huff and puff and blow your house down!
That was completely irrelevant. This challenge is actually about Huffman coding. The gist of it is the frequency of characters in a given text is utilized to make its representation shorter. In other words, let's say that our alphabet is a through z and space. That's 27 characters. Each of them can be uniquely encoded in just 5 bits because 5 bits have enough room for 32 characters. However, in many situations (like English, or languages in general), some characters are more frequent than others. We can use fewer bits for the more frequent characters and (perhaps) more bits for the less frequent characters. Done right, there is an overall savings in the number of bits and the original text can still be uniquely reconstructed.
Let's take "this question is about huffman coding" as an example. This text is 37 characters long, which would be 37*8 = 296 bits normally, though only 37*5 = 185 bits if we only use 5 bits for each character. Keep that in mind.
Here is a (sorta) table of each character and their frequencies in the text, sorted from most to least frequent (where _ stands in for a space):
_ 5
i 4
n 3
o 3
s 3
t 3
u 3
a 2
f 2
h 2
b 1
c 1
d 1
e 1
g 1
m 1
q 1

An associated optimal coding could be:
_ 101
i 011
n 1100
o 1101
s 1110
t 1111
u 001
a 10011
f 0001
h 0101
b 00000
c 00001
d 01000
e 01001
g 10000
m 10001
q 10010

It should be immediately clear that this will be a better encoding than just using 5 bits for every character. Let's find out just how much better, though!
145 bits, compared with 185! That's a savings of 40 bits, or just over 20%! (This is, of course, assuming that information about the structure is available for decoding.) This coding is optimal because no more bits can be dropped by changing any character's representation.
The task

Write a program or function with one parameter that...
Takes input from STDIN (or equivalent) or as a single argument.
Output an optimal Huffman coding as above with the characters sorted by frequency (order within a frequency class doesn't matter).
You may assume that the characters in the input are restricted to the ASCII range 32..126 plus a newline.
You may assume the input is no longer than 10,000 characters (ideally, in theory, input should be unbounded).
Your code should finish reasonably fast. The given example above should take no more than a minute or so at worst. (This is intended to rule out brute force.)
Scoring is in bytes.

Examples
x
---
x 0

xxxxxxxxx
---
x 0

xxxxxxxxy
---
x 0
y 1 (these may be swapped)

xxxxxyyyz
---
x 0
y 10
z 11

uuvvwwxxyyzz
---   (or)
u 000      000
v 001      001
w 100      010
x 101      011
y 01       10
z 11       11

this question is about huffman coding
---
  101
i 011
n 1100
o 1101
s 1110
t 1111
u 001
a 10011
f 0001
h 0101
b 00000
c 00001
d 01000
e 01001
g 10000
m 10001
q 10010

Happy coding!

Note that this similar question is closely related, even to the point that this one is a duplicate. However, the consensus so far on Meta is that the older one should be considered a duplicate of this one.

I disagree with your note: it's the same question which for the existing answers requires a simple transformation of output format, and moreover any answer to this question is automatically an answer to the previous question.

@PeterTaylor: I'd like to petition again that you reopen this question. The specification in this one is better (as said by Martin) and I want to see newer, better answers, including Pyth and CJam answers. I think there's no harm in leaving both questions open because they are sufficiently different. Only two of five users who posted on that question have been on this site recently.

@PeterTaylor: Also, going by this standard, I'd like to say that I don't think answers could be copied between questions and remain competitive. Finally, the other question is four years old. It'd be good to have a fresh version.

In your example of this question is about huffman coding, I counted the number of bits to be 145, not 136.

I was really trying to complete this challenge in Spoon, but after 2 hours of brainfuckery I decided it would be best to give up...

I also got 145 bits, not 139 bits.

@TFeld: You're right. I've fixed it.

@isaacg: You're right, my mistake.

Employing a suitable strategy for transmitting the dictionary along with the compressed data is an important and often over-looked aspect of compression. A poor strategy ruins many implementations.....
Also, how on earth can something be deemed a duplicate of something created many years later?

@enhzflep: Read the linked Meta thread.

@El'endiaStarman - Ah, gotcha. It's the only way to use the limited tools of the SO network to achieve the desired result. I agree that this is the better formulated challenge. The anal part of me simply has a problem with closing "as a duplicate" along with the text "already has an answer here". I guess the chosen option (dup) is the one that fits least badly.

Pyth, 53 bytes
jo_/zhNee.WtHa>JohNZ2+shKC<J2]s.b+RYNeKU2m,/zd]+d\ {z

Demonstration
Here's a version that shows the internal state, so you can see the encoding being built:
jo_/zhNee.WtHvp+`a>JohNZ2+shKC<J2]s.b+RYNeKU2bm,/zd]+d\ {z

Demonstration
Copy the output to an environment with wider lines for a clearer picture.

Python 2, 299 bytes
Here's my attempt at an answer.
The Huffman codes are different from the examples given, but should still be optimal.
i=raw_input();m=n=[(c,i.count(c))for c in set(i)]
while n[1:]:n.sort(key=lambda x:(x[1]));(a,b),(c,d)=n[:2];n=[((a,c),b+d)]+n[2:]
n=n[0][0]
r=[]
def a(b,s):
 if b[1:]:a(b[0],s+'0');a(b[1],s+'1')
 else:r.append(b+(s if s[1:]else s+'0'))
a(n,' ')
for y in sorted(r,key=lambda x:-dict(m)[x[0]]):print y

Matlab, 116 bytes
tabulate makes a frequency table. huffmandict takes a list of symbols and probabilities for each symbol, and calculates the code.
t=tabulate(input('')');
d=huffmandict(t(:,1),cell2mat(t(:,3))/100);
for i=1:size(d,1);disp([d{i,1},' ',d{i,2}+48]);end

Ruby, 189 180 bytes
Work in progress.
->s{m=s.chars.uniq.map{|c|[c,s.count(c)]}
while m[1]
(a,x),(b,y),*m=m.sort_by &:last
m<<[[a,b],x+y]
end
h={}
f=->q="",c{Array===c&&f[q+?0,c[0]]&&f[q+?1,c[1]]||h[c]=q}
f[m[0][0]]
h}

It's an anonymous function; assign it to something, for example f, and call it with
f["some test string"]`

which returns a hash like this:
{"t"=>"00", "g"=>"0100", "o"=>"0101", " "=>"011", "e"=>"100", "n"=>"1010", "i"=>"1011", "m"=>"1100", "r"=>"1101", "s"=>"111"}

Haskell, 227 bytes
import Data.List
s=sortOn.(length.)
f x|[c]<-nub x=[(c,"0")]|1<2=g[(a,[(a!!0,"")])|a<-group$sort x]
g=h.s fst
h[x]=snd x
h((a,b):(c,d):e)=g$(a++c,map('0'#)b++map('1'#)d):e
n#(a,b)=(a,n:b)
p=unlines.map(\(a,b)->a:" "++b).s snd.f

Usage example:
*Main> putStr $ p "this question is about huffman coding"
u 000
i 011
  101
a 0010
f 0011
h 1000
s 1100
t 1101
n 1110
o 1111
d 01000
e 01001
b 01010
c 01011
q 10010
g 100110
m 100111

How it works:
p calls f which builds the Huffman table in the form of a list of (character,encoding)-pairs, e.g. [ ('a',"0"), ('b',"1") ], sorts the table by length of encodings, formats each pair for output and joins with newlines in-between.
f first checks the single letter case and returns the corresponding table. Otherwise it sorts the input string and groups sequences of equal characters (e.g. "ababa" -> ["aaa","bb"]) and maps them to pairs (sequence , [(char, "")]), (-> [ ("aaa", [('a',"")]), ("bb", [('b', "")])]. The first element is used to keep track of the frequency, the second element is a list of pairs of a character and it's encoding (which is initially empty). These are all single element Huffman tables as expected by p and are combined by g and h.
g sorts the list of pairs on the length of the first element, i.e. the frequency and calls h. h combines the Huffman tables of the first two elements, by concatenating the frequencies and putting a 0 (1) in front of every element of the first (second) table. Concatenate both tables. Call g again, stop when there's a single element left, throw away the frequency part and return the full Huffman table.

K (ngn/k), 78 bytes
{h::0#'x;(#1_){{h[x],:!2;y,,,/x}.0 2_x@<#'x}/.=x;(?,/'x,'" ",'|'$h)(?x)?>#'=x}

Try it online!
returns a list of strings for printing
h::0#'x creates an empty list for each character (technically, it reshapes each character to length 0). we will store the reversed huffman codes there. we use :: instead of : for assignment to make h global so it's visible in sub-functions.
.=x is a list of lists - the indices of the string grouped by character value
(#1_) is a function that returns truthy iff the length of the argument is >1 (technically "length of 1 drop of ...")
(#1_){...}/ means: while the argument has length >1, keep applying the curly-brace function
x@<#'x sort the argument by length
0 2_ cut it into a 2-element head and a tail
{h[x],:!2;y,,,/x} update h by appending 0 and 1 to the indices contained in the head; return the tail with the head as a single element
(?,/'x,'" ",'|'$h)(?x)?>#'=x reverse each of h, sort, unique, prepend corresponding characters, and format nicely

JavaScript (ES6) 279
Essentially, the basic algorithm from Wikipedia. I probably can do better.
f=s=>{for(n=[...new Set(s)].map(c=>({c:c,f:[...s].filter(x=>x==c).length}));n[1];n.push({l:a=n.pop(),r:b=n.pop(),f:a.f+b.f,c:a.c+b.c}))n.sort((a,b)=>b.f-a.f);t=(n,b)=>(n.b=b,n.r)?(t(n.l,b+0),t(n.r,b+1)):o.push(n);t(n[0],'',o=[]);return o.sort((a,b)=>b.f-a.f).map(x=>x.c+' '+x.b)}

More readable inside the snippet below

f=s=>{
  for(n=[...new Set(s)].map(c=>({c:c,f:[...s].filter(x=>x==c).length}));
      n[1];
      n.push({l:a=n.pop(),r:b=n.pop(),f:a.f+b.f,c:a.c+b.c}))
    n.sort((a,b)=>b.f-a.f);
  t=(n,b)=>(n.b=b,n.r)?(t(n.l,b+0),t(n.r,b+1)):o.push(n);
  t(n[0],'',o=[]);
  return o.sort((a,b)=>b.f-a.f).map(x=>x.c+' '+x.b)
}

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

test=['xxxxxxxxy','uuvvwwxxyyzz','this question is about huffman coding']
.forEach(t=>console.log(t+'\n'+f(t).join`\n`+'\n'))


text:
Coloring the switchboard red
Question

If you are currently on a cell with a value x, you can move to any
  cell in the same row or column, provided it has a value y such that x >
  y. This move is called a switch.

The input consists of:

two integers 0 < m,n < 50
an integer k indicating the number of switches allowed 0 < k < 20
an m by n grid filled with integers in the range -128 to 127

The output consists of:

a single integer r, indicating the minimum number of cells that have to be coloured red to satisfy the condition.

The condition is that:

if any cell is selected on the switchboard, it must be possible to

start at any red cell of your choice
make upto k switches
end up at the selected cell

the output must be reached within 60 seconds using any amount of memory.

Sample data
Inputs
(a) 7 8 10
55 25 49 40 55 3 55
33 32 26 59 41 40 55
31 23 41 58 59 14 33
9 19 9 40 4 40 40
55 54 55 46 52 39 41
10 41 7 47 5 30 54
40 22 31 36 7 40 28
21 40 41 59 14 36 31

(b) 9 8 10
50 98 54 6 34 94 63 52 39
62 46 75 28 65 18 37 18 97
13 80 33 69 93 78 19 40 13
94 10 88 43 61 72 94 94 94
41 79 82 27 71 62 57 67 34
8 93 2 12 93 52 91 86 93
94 79 64 43 32 94 42 91 9
25 73 29 31 19 70 58 12 11

(c) 10 9 10
50 54 6 34 78 63 52 39 41 46
75 28 65 18 37 18 13 80 33 69
78 19 40 13 10 43 61 72 13 46
56 41 79 82 27 71 62 57 67 81
8 71 2 12 52 81 1 79 64 81
32 41 9 25 73 29 31 19 41 58
12 11 41 66 63 14 39 71 38 16
71 43 70 27 78 71 76 37 57 12
77 50 41 81 31 38 24 25 24 81

Outputs
(a) 9
(b) 9
(c) 8

Winning
You may use any language. Shortest code wins.

Am I missing something, or are the sample inputs missing m,n,k?

@Geobits Oh, yes. I forgot to add it.

What exactly is a switchboard? How does it relate to this challenge?

I think the wording here is hard to digest. Let me say if I've understood right: You have a m*n grid of values, and a legal move consists of moving from a cell in the grid to another cell in the same row or column that has a strictly lower value. What is the minimum size r of a subset S of cells such that union of all length-r paths with start points in S covers the whole grid?

@xnor You're almost correct. Only thing that you missed out is that each path starts at a red cell, makes less than or equal to k turns and terminates. And every cell must be reachable by such a path.


text:
The Combinatorics of Transistor
The video game Transistor features a very interesting ability system. You collect 16 "Functions" which you can use in 16 different slots. What's interesting is that there are 3 types of slots and every Function behaves differently according to which slot you use it in:

There are 4 Passive Slots.
There are 4 Active Slots.
Each Active Slot has 2 Upgrade Slots.

We want to figure out how many different skill sets that gives us.
However, some combinations are equivalent. In particular, within each of those groups of slots, the specific position of a Function doesn't matter. On the other hand, the effect of a Function in an Upgrade Slot does depend on the specific Function used in the parent Active Slot.
Therefore, using hexadecimal digits to stand in for the Functions, the following combinations are all equivalent:
Passive Slots:    0     1     2     3
Active Slots:     4     5     6     7
Upgrade Slots:   8 9   A B   C D   E F

Passive Slots:    2     0     1     3    # Permutation of passive slots.
Active Slots:     4     5     6     7
Upgrade Slots:   8 9   A B   C D   E F

Passive Slots:    0     1     2     3
Active Slots:     5     6     4     7    # Permutation of active slots together
Upgrade Slots:   A B   C D   8 9   E F   # with their upgrade slots.

Passive Slots:    0     1     2     3
Active Slots:     4     5     6     7
Upgrade Slots:   8 9   B A   C D   F E   # Permutation within upgrade slots.

as well as any combination of these rearrangings. Note that in the third case the Upgrade Slots were swapped along with the Active Slots to maintain the same overall effect.
On the other hand, the following combinations are all different from the above set:
Passive Slots:    4     5     6     7    # Passive slots swapped
Active Slots:     0     1     2     3    # with active slots.
Upgrade Slots:   8 9   A B   C D   E F

Passive Slots:    0     1     2     3
Active Slots:     5     4     6     7    # Permutation of active slots without
Upgrade Slots:   8 9   A B   C D   E F   # changing upgrade slots.

Passive Slots:    0     1     2     3
Active Slots:     4     5     6     7
Upgrade Slots:   8 A   9 B   C D   E F   # Permutation between different upgrade slots.

By my count that gives you 2,270,268,000 possible (functionally distinct) combinations, assuming all Functions are used.
If you have less than 16 Functions at your disposal, some of the slots will remain empty. However, note that you can't place a Function in an Upgrade Slot if the parent Active Slot is empty.
The Challenge
You're to determine the number of possible configurations depending on how many functions you have. Furthermore, I will generalise the problem slightly by making the number of slots variable, in order to prevent trivial hardcoding solutions.
Write a program or function which, given two positive integers M ≥ 1 and 1 ≤ N ≤ 4M, determines the number of possible (functionally distinct) skill sets assuming exactly N different Functions are used to fill as many as possible of M Passive, M Active and 2M Upgrade Slots.
You may write a program or function, taking input via STDIN (or closest alternative), command-line argument or function argument and outputting the result via STDOUT (or closest alternative), function return value or function (out) parameter.
Your code must be able to handle any input up to and including M = 8 within one minute on a reasonable desktop machine. There is some leeway in this, but it should rule out brute force solutions. In principle it should be no issue to solve any of those inputs in less than a second.
This is code golf, the shortest answer (in bytes) wins.
Test Cases
Each test case is in the form M N => Result.
1 1 => 2
1 2 => 4
1 3 => 9
1 4 => 12
2 1 => 2
2 2 => 6
2 3 => 21
2 4 => 78
2 5 => 270
2 6 => 810
2 7 => 1890
2 8 => 2520
3 1 => 2
3 2 => 6
3 3 => 23
3 4 => 98
3 5 => 460
3 6 => 2210
3 7 => 10290
3 8 => 44520
3 9 => 168840
3 10 => 529200
3 11 => 1247400
3 12 => 1663200
4 1 => 2
4 2 => 6
4 3 => 23
4 4 => 100
4 5 => 490
4 6 => 2630
4 7 => 14875
4 8 => 86030
4 9 => 490140
4 10 => 2652300
4 11 => 13236300
4 12 => 59043600
4 13 => 227026800
4 14 => 718918200
4 15 => 1702701000
4 16 => 2270268000
5 1 => 2
5 2 => 6
5 3 => 23
5 4 => 100
5 5 => 492
5 6 => 2672
5 7 => 15694
5 8 => 98406
5 9 => 644868
5 10 => 4306932
5 11 => 28544670
5 12 => 182702520
5 13 => 1101620520
5 14 => 6122156040
5 15 => 30739428720
5 16 => 136670133600
5 17 => 524885961600
5 18 => 1667284819200
5 19 => 3959801445600
5 20 => 5279735260800
6 1 => 2
6 2 => 6
6 3 => 23
6 4 => 100
6 5 => 492
6 6 => 2674
6 7 => 15750
6 8 => 99862
6 9 => 674016
6 10 => 4787412
6 11 => 35304654
6 12 => 265314588
6 13 => 1989295308
6 14 => 14559228684
6 15 => 101830348620
6 16 => 667943115840
6 17 => 4042651092480
6 18 => 22264427465280
6 19 => 110258471363040
6 20 => 484855688116800
6 21 => 1854067032417600
6 22 => 5894824418683200
6 23 => 14025616720315200
6 24 => 18700822293753600
7 1 => 2
7 2 => 6
7 3 => 23
7 4 => 100
7 5 => 492
7 6 => 2674
7 7 => 15752
7 8 => 99934
7 9 => 676428
7 10 => 4849212
7 11 => 36601554
7 12 => 288486132
7 13 => 2349550632
7 14 => 19504692636
7 15 => 162272450340
7 16 => 1328431104000
7 17 => 10507447510560
7 18 => 78942848624640
7 19 => 554967220167360
7 20 => 3604592589998400
7 21 => 21411337810262400
7 22 => 115428212139240000
7 23 => 561247297649438400
7 24 => 2439121536313862400
7 25 => 9283622495827680000
7 26 => 29520583763711040000
7 27 => 70328449554723360000
7 28 => 93771266072964480000
8 1 => 2
8 2 => 6
8 3 => 23
8 4 => 100
8 5 => 492
8 6 => 2674
8 7 => 15752
8 8 => 99936
8 9 => 676518
8 10 => 4852992
8 11 => 36722169
8 12 => 291621462
8 13 => 2418755196
8 14 => 20834571186
8 15 => 184894557705
8 16 => 1672561326150
8 17 => 15217247948760
8 18 => 137122338089880
8 19 => 1204392465876600
8 20 => 10153538495100000
8 21 => 81007229522419200
8 22 => 604136189949692400
8 23 => 4168645459350372000
8 24 => 26403795950145213600
8 25 => 152700324078982680000
8 26 => 803784718213396920000
8 27 => 3838761204861983400000
8 28 => 16503742828841748480000
8 29 => 62545434470667308160000
8 30 => 198853691115980300400000
8 31 => 474189571122722254800000
8 32 => 632252761496963006400000

These are all the inputs your code has to handle within one minute (each), but it should in principle work for larger inputs. You can use some of the following M = 10 test cases to check that:
10 1 => 2
10 2 => 6
10 3 => 23
10 4 => 100
10 5 => 492
10 6 => 2674
10 7 => 15752
10 8 => 99936
10 9 => 676520
10 10 => 4853104
10 11 => 36727966
10 12 => 291849866
10 13 => 2426074222
10 14 => 21033972388
10 15 => 189645995396
10 16 => 1773525588406
10 17 => 17155884420532
10 18 => 171073929494468
10 19 => 1750412561088334
10 20 => 18258387148774916
10 21 => 192475976310317700
10 22 => 2028834600633220380
10 23 => 21127206177119902860
10 24 => 214639961631544809360
10 25 => 2101478398293813739200
10 26 => 19602967930531817832000
10 27 => 172444768103233181556000
10 28 => 1417975382888905296456000
10 29 => 10820259026484304813416000
10 30 => 76213534343700480310584000
10 31 => 493916052421168703366040000
10 32 => 2941900199368102067135040000
10 33 => 16113144277547868007416960000
10 34 => 81222252655277786422930560000
10 35 => 376309102059179385262246080000
10 36 => 1589579966324953534441910400000
10 37 => 5981477408861097281112374400000
10 38 => 19005991357166148698688124800000
10 39 => 45381652832417130566255318400000
10 40 => 60508870443222840755007091200000

Is it mandatory to fill as many slots as possible?

I guess I had better wait for my turn() before I help() you get() any answers to load(), or else I might need to ping() you from the void() after I spark() and crash()..... Man...

@feersum Yes, all N functions are in use.

CJam (56 bytes)
q~4@:Nm*:$_&{:+1$\-N),&},f{1$1$:+-\0-:(_e`0f=+++:m!:/}:+

Online demo
This is an optimised version of the reference implementation I wrote for the sandbox. Note: I use N in the code because in a Real Combinatorics Question™ the parameters are \$n\$ and \$k\$, not m and n, but I'll use \$M\$ and \$N\$ in the explanation to avoid further confusion.
Suppose that we assign \$X\$ functions to the passive slots (where obviously \$0 \le X \le M\$). Then we have \$N-X\$ functions left for the active + upgrade slots (and we can choose those functions in \$\frac{N!}{X!(N-X)!}\$ ways). Because the order of the slot constellations is irrelevant, we want to consider each partition of \$N-X\$ into at most \$M\$ parts each of at most \$3\$ exactly once.
Take partition \$λ_0, λ_1, \ldots, λ_k\$. We can assign \$λ_0\$ parts to the first slot constellation, \$λ_1\$ to the second, etc. in \$\frac{(N-X)!}{λ_0! λ_1! ... λ_k!}\$ ways (multinomial), but we need to compensate for two factors. Firstly, if we have \$λ_i = λ_j\$ then the constellations are interchangeable, so we further divide by the factorials of the multiplicities of each part, \$μ_i\$. (E.g. the partition 3 2 2 1 has \$μ_3 = 1\$, \$μ_2 = 2\$, \$μ_1 = 1\$). Secondly, we have a designated "active" slot in each constellation, so for each \$λ_i\$ we multiply by \$λ_i\$ ways to select the active function.
So for each partition the number of distributions of functions is
$$\frac{N!}{X! (λ_0-1)! \ldots (λ_k-1)! μ_1! μ_2! μ_3!}$$
The code above computes the partitions using the same approach as Dennis (it's obvious and short, although not very scalable) and then processes each partition into an array similar to [N X λ_0-1 ... λ_k-1 μ_1 μ_2 μ_3] over which it can lift the factorial function and then fold division.

CJam, 74 67 bytes
q~4@:Mm*:$L|{:+W$\-M),&},f{0-:F1@@{_m!\I-:Nm!/I(m!/*N}fI;Fm!Fe=/}:+

I've verified all test cases on my desktop computer using the Java interpreter. This took 2.2 seconds for 1 ≤ M ≤ 8 and 3.5 minutes for M = 10.
Try this fiddle in the CJam interpreter or verify the first 84 test cases at once.
Idea
In principle, we can fill each active slot and its corresponding upgrade slots with 0, 1, 2 or 3 functions. For 4M slots in total, we take all vectors V of {0, 1, 2, 3}M and filter out those for which sum(V) > N (more functions in non-passive slots than total functions available) or sum(V) + M < N (not enough passive slots for non-active functions). We sort and deduplicate all kept vectors, since the order of the slot families in not important.
With N functions and V = (x1, …, xM) functions in the non-passive parts of the slot families, we calculate the number of combinations as follows:

If x1 = 0, there is only one possibility for that slot family.
If x1 = 1, there are N possibilities, since we have N functions, and the function must go in the active slot.
If x1 = 2, we must place one function in the active slot and another in an upgrade slot (it doesn't matter which). There are N choices for the active slot and N-1 remaining choices for the upgrade slot, giving a total of N(N-1) combinations.
If x1 = 3, there are N choices for the active slot, N - 1 remaining choices for the first upgrade slot and N - 2 for the second upgrade slot. Since the upgrade slots have no order, this counts every combination twice, so there are N(N - 1)(N - 2) unique combinations.
In any case, there are N! / ((N - x1)! × (x1 - 1)! combinations for this family.
We have used up x1 functions, so set N := N - x1 and repeat step 1 for x2, then x3, etc.
If V contains duplicates, the product of the above results will have counted all combinations multiple times. For each unique element of V, if it occurs r times in V, there are r! equivalent ways
to arrange these slot families, so the result from above must be devided by r!.
The final result is the number of unique combinations for that V.

To calculate the total number of unique combinations, all that's left to do is to compute the sum of the results for each V.
Code
q~        e# Read an evaluate all input from STDIN. Pushes M and N.
4@:M      e# Push 4, rotate the M, and formally save it in M.
m*        e# Push {0, 1, 2, 3}^M.
:$        e# Sort each vector.
L|        e# Perform set union with the empty list (deduplicates).
{         e# For each sorted vector:
  :+      e#   Compute the sum of its coordinates.
  W$\-    e#   Subtract the sum from N (bottom of the stack).
  M),&    e#   Push [0 ... M] and intersect.
},        e# If the intersection was not empty, keep the vector.
f{        e# For each kept vector, push N and V; then:
  0-:F    e#   Save the non-zero elements of V in F.
  1@@     e#   Push 1 (accumulator), and rotate N and F on top of it.
  {       e#   For each I in F:
    _m!   e#     Push I and push factorial(I).
    \I-:N e#     Subtract I from N and update N.
    m!/   e#     Divide factorial(N) (original N) by factorial(N) (updated N).
    I(m!/ e#     Divide the quotient by factorial(I - 1).
    *     e#    Multiply the accumulator by the resulting quotient.
    N     e#    Push N for the next iteration.
  }fI     e#
  ;       e#   Pop N.
  Fm!     e#   Push all non-unique permutations of F.
  Fe=     e#   Count the number of times F appears.
  /       e#   Divide the accumulator by the result.
}         e#
:+        e# Add all resulting quotients.