Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

I made my own web-browser

Name: Anonymous 2013-11-20 7:21


#!/usr/bin/env python2
import nltk
import urllib

print "Welcome to the Matrix Neo."
while True:
    url = raw_input("Can I get a URL? \n")
    print nltk.clean_html(urllib.urlopen("http://"; + url).read())

Name: Anonymous 2013-11-20 7:22

Goddang accidentally typing in a semicolon before posting.

Name: Anonymous 2013-11-20 7:31

8 lines?
Talk about bloat.
Here's my own in 2 lines.
#!/bin/sh
firefox

Name: Anonymous 2013-11-20 7:59

>>3

my C++ compiler in 2 lines.


#!/bin/sh
gcc

Name: Anonymous 2013-11-20 8:04

>>3
That's cheating.

#!/usr/bin/env python2
import webbrowser

print "Welcome to the Matrix Neo. Get ready to hack."
url = raw_input("Can I get a URL? \n")
webbrowser.open("http://"; + url)

Name: Anonymous 2013-11-20 8:05

>>5
Fuck does it keeping automatically entering a semicolon?


this is a test "http://"; http:// http:

Name: Anonymous 2013-11-20 10:57

>>1
It looks cool, but the source code is too complicated for me to determine if it secretly installs malware or not, so I guess I'll never really know what it does.

Name: Cudder !MhMRSATORI!fR8duoqGZdD/iE5 2013-11-21 9:23

I have been writing one, and in the process discovered that the HTML5 specification has one of the worst descriptions of algorithms I've ever seen.

Just look at the "reconstruct the active formatting elements" algorithm here:
http://www.w3.org/TR/2010/WD-html5-20101019/parsing.html#the-list-of-active-formatting-elements

Name: Anonymous 2013-11-21 10:33

>>11
seems fine to me, if a little bit odd

Name: Anonymous 2013-11-21 10:40

>>11
The target audience for that doc are probably "web developers"

Name: Anonymous 2013-11-21 10:50

>>11
Can i touch your tooshie?

Name: Anonymous 2013-11-21 13:57


????☜

*poke*

Name: Anonymous 2013-11-21 14:57

(ql:quickload :trivial-shell)
(trivial-shell:shell-command "firefox")

Has every feature of firefox!

Name: Anonymous 2013-11-21 17:26

LISP

Name: Cudder !MhMRSATORI!fR8duoqGZdD/iE5 2013-11-22 0:29

>>12
It's got some bloody gotos in it! Not reasonable uses of them (error handling, breaking out of deep loops, etc.) either! They could've written it a lot clearer with a regular loop, and been a lot less verbose too; what is easier to understand, their version or this?

"If the list of active formatting elements (loafe) is empty, nothing more need be done. Scan the loafe backwards until either [1] the head entry is reached, [2] the entry preceding the current entry is a marker, or [3] the entry preceding the current entry is an element in the stack of open elements (soee). Beginning at this entry and continuing for each entry until the end of the loafe, duplicate these elements in the order they are in the loafe, and chain them such that each successive element is the child of the element before it in the loafe, and append the top of this resulting chain to the current element. Push this chain onto the soee."

To me their description looks either like they tried to emulate Knuth and failed, or decompiled browser code and wrote what it does, without going beyond the goto-level. The algorithm is really just two loops, but nothing about their description suggests that.

>>13
No, this part of the spec is definitely for browser writers.

Name: Cudder !MhMRSATORI!fR8duoqGZdD/iE5 2013-11-23 10:45

"Web" mini-rant #2...

FUCK DEPRECATION! The HTML5 spec says that some features are "deprecated" or "nonstandard", yet right in the goddamn standard itself they go on in great length to specify exactly what they should do (which is far from "ignored because deprecated".) In other words, they have basically standardised the behaviour of existing implementations so that newer ones can behave just right (i.e. your browser must implement these features to claim HTML5 compliance), but then turn around and say that those writing webpages can't use those now-standard features, on which much effort was expended to ensure that they are present both in the spec and in implementation?!?! What a load of bullshit!

What the bloody hell is wrong with the W3C wankers? Drank too much of their "semantic web" Kool-Aid? CSS is nice because you can give a name to a whole set of styles and have them apply and cascade on multiple elements, without needing to say e.g. <span style="x y z ..."> multiple times. Where it stops becoming a good thing is when the "semantic web" bullshittists came up with the brillant idea that, since all the existing formatting you can do with elements like center, b, u, font, etc., you can do with CSS, let's "deprecate" those elements (which were born out of a very damn good reason - because they're what people want to use for formatting often) and reinvent them using CSS! Everything is a div or span (or not even that - you could turn everything into divs if you applied the right CSS rules to turn some of those divs to behave like spans!)

So now, if you drank all that Kool-Aid, what you're supposed to do to remain "pure" is make your whole webpage a bunch of these generic elements, assign class names to them, and then reinvent the formatting by writing CSS --- which, I repeat, is already hardcoded into the browser for those "deprecated" elements!!! What's the difference between <b>Some text</b> and <span class=b>Some text</b> + .b {font-weight:bold;}? A load of extra unnecessary work and code, that's what! The browser already knows that b elements are associated with something like a CSS rule that bolds their font, so all you've done is reimplement the same goddamn functionality the browser already has and come up with a very roundabout way of bolding some text! If you have a requirement for many elements to have the same formatting with a complex style, then CSS makes perfect sense, because there's no existing element that matches what you want to do and you don't want to repeat yourself setting the same style on every one of them. But basic formatting? That's already built-in. Fuck the W3C and the bloody "semantic web" bullshit wankers for completely departing from common sense.

</rant> (or should that be <span class=rant>... </span> and a few pages detailing what "rant" means ...)

Name: Anonymous 2013-11-23 11:02

Cudder just need a good shag.

Name: Anonymous 2013-11-23 15:03

>─────▄████▀█▄
   >───▄█████████████████▄
   >─▄█████.▼.▼.▼.▼.▼.▼▼▼▼
   >▄███████▄.▲.▲▲▲▲▲▲▲▲
   >███████████████████▀▀
   YOU HAVE BEEN CAUGHT BY THE GATOR OF DOOM! REPOST THIS 5 TIMES OR GET GATORED!!!

Name: Anonymous 2013-11-23 15:03

>─────▄████▀█▄
   >───▄█████████████████▄
   >─▄█████.▼.▼.▼.▼.▼.▼▼▼▼
   >▄███████▄.▲.▲▲▲▲▲▲▲▲
   >███████████████████▀▀
   YOU HAVE BEEN CAUGHT BY THE GATOR OF DOOM! REPOST THIS 5 TIMES OR GET GATORED!!!

Name: Anonymous 2013-11-23 15:03

>─────▄████▀█▄
   >───▄█████████████████▄
   >─▄█████.▼.▼.▼.▼.▼.▼▼▼▼
   >▄███████▄.▲.▲▲▲▲▲▲▲▲
   >███████████████████▀▀
   YOU HAVE BEEN CAUGHT BY THE GATOR OF DOOM! REPOST THIS 5 TIMES OR GET GATORED!!!

Name: Anonymous 2013-11-23 15:03

>─────▄████▀█▄
   >───▄█████████████████▄
   >─▄█████.▼.▼.▼.▼.▼.▼▼▼▼
   >▄███████▄.▲.▲▲▲▲▲▲▲▲
   >███████████████████▀▀
   YOU HAVE BEEN CAUGHT BY THE GATOR OF DOOM! REPOST THIS 5 TIMES OR GET GATORED!!!

Name: Anonymous 2013-11-23 15:04

>─────▄████▀█▄
   >───▄█████████████████▄
   >─▄█████.▼.▼.▼.▼.▼.▼▼▼▼
   >▄███████▄.▲.▲▲▲▲▲▲▲▲
   >███████████████████▀▀
   YOU HAVE BEEN CAUGHT BY THE GATOR OF DOOM! REPOST THIS 5 TIMES OR GET GATORED!!!

Name: Cudder !MhMRSATORI!fR8duoqGZdD/iE5 2013-11-28 10:53

Here's one that's even more verbose and convoluted:
http://www.w3.org/TR/html5/syntax.html#adoption-agency-algorithm

One also has to wonder why they had to go out of their way to specify "parse errors" and their precise handling; since HTML5 was designed so that all browsers would behave the same in parsing HTML, they've essentially eliminated all undefined/implementation-defined behaviour. When the same text, whether "valid" HTML or not, will be displayed and behave the same in all browsers, does "validity" and "parse errors" really make a difference anymore? It's not like a compiler/programming language where a syntax error usually means not even able to compile - the "soft" error characteristics of HTML meant that previously, you would still get some sort of rendering, although differing across browsers, and that was a good reason to write "valid" HTML, but now with HTML5 there is (or shouldn't be!) a difference anymore.

Don't change these.
Name: Email:
Entire Thread Thread List