Re: For those ready to take the challenge

2015-01-10 Thread Adam D. Ruppe via Digitalmars-d-learn
On Saturday, 10 January 2015 at 19:17:22 UTC, Ola Fosheim Grøstad wrote: Nice and clean code; does it expand html entities ("&")? Of course. It does it both ways: a & span.innerText == "a &" span.innerText = "a \" b"; assert(span.innerHTML == "a " b"); parseGarbage also tries to fix broken

Re: For those ready to take the challenge

2015-01-10 Thread via Digitalmars-d-learn
On Saturday, 10 January 2015 at 17:39:17 UTC, Adam D. Ruppe wrote: Though, that's still a library thing rather than a language thing. It is a language-library-platform thing, things like how composable the eco system is would be interesting to compare. But it would be unfair to require a mini

Re: For those ready to take the challenge

2015-01-10 Thread Vladimir Panteleev via Digitalmars-d-learn
On Saturday, 10 January 2015 at 14:56:09 UTC, Adam D. Ruppe wrote: On Saturday, 10 January 2015 at 13:22:57 UTC, Nordlöw wrote: on dmd git master. Ideas anyone? Don't use git master :P Do use git master. The more people do, the fewer regressions will slip into the final release. You can u

Re: For those ready to take the challenge

2015-01-10 Thread MattCoder via Digitalmars-d-learn
On Friday, 9 January 2015 at 13:50:29 UTC, eles wrote: https://codegolf.stackexchange.com/questions/44278/debunking-stroustrups-debunking-of-the-myth-c-is-for-large-complicated-pro From the link: "Let's show Stroustrup what small and readable program actually is." Alright, there are a lot a

Re: For those ready to take the challenge

2015-01-10 Thread Adam D. Ruppe via Digitalmars-d-learn
On Saturday, 10 January 2015 at 17:23:31 UTC, Ola Fosheim Grøstad wrote: For the challenge to make sense it would entail parsing all legal HTML5 documents, extracting all resource links, converting them into absolute form and printing them one per line. With no hickups. Though, that's still a

Re: For those ready to take the challenge

2015-01-10 Thread via Digitalmars-d-learn
On Saturday, 10 January 2015 at 15:52:21 UTC, Tobias Pankrath wrote: I think he's wrong, because it spoils the comparison. Every answer should delegate those tasks to a library that Stroustroup used as well, e.g. regex matching, string to number conversion and some kind of TCP sockets. But it m

Re: For those ready to take the challenge

2015-01-10 Thread Paulo Pinto via Digitalmars-d-learn
On Saturday, 10 January 2015 at 15:52:21 UTC, Tobias Pankrath wrote: ... The thing is, in languages like Perl, Python, Ruby (to name a few), reusing someone else's code is not only easy, but it is how most people actually write code most of the time. I think he's wrong, because it spoils the

Re: For those ready to take the challenge

2015-01-10 Thread Adam D. Ruppe via Digitalmars-d-learn
On Saturday, 10 January 2015 at 15:52:21 UTC, Tobias Pankrath wrote: But it must do the same work that he's solution does: Create and parse HTML header and extract the html links, probably using regex, but I wouldn't mind another solution. Yeah, that would be best. BTW interesting line here:

Re: For those ready to take the challenge

2015-01-10 Thread Tobias Pankrath via Digitalmars-d-learn
On Saturday, 10 January 2015 at 15:13:27 UTC, Adam D. Ruppe wrote: On Saturday, 10 January 2015 at 12:34:42 UTC, Tobias Pankrath wrote: Since it is a comparison of languages it's okay to match the original behaviour. I don't think this is really a great comparison of languages either though b

Re: For those ready to take the challenge

2015-01-10 Thread Daniel Kozak via Digitalmars-d-learn
Vladimir Panteleev via Digitalmars-d-learn píše v So 10. 01. 2015 v 07:42 +: > On Saturday, 10 January 2015 at 02:10:04 UTC, Jesse Phillips > wrote: > > On Friday, 9 January 2015 at 13:50:29 UTC, eles wrote: > >> https://codegolf.stackexchange.com/questions/44278/debunking-stroustrups-debunkin

Re: For those ready to take the challenge

2015-01-10 Thread Adam D. Ruppe via Digitalmars-d-learn
On Saturday, 10 January 2015 at 15:24:45 UTC, bearophile wrote: Is the issue in Bugzilla? https://issues.dlang.org/show_bug.cgi?id=13966

Re: For those ready to take the challenge

2015-01-10 Thread Adam D. Ruppe via Digitalmars-d-learn
On Saturday, 10 January 2015 at 15:24:45 UTC, bearophile wrote: Is the issue in Bugzilla? I don't know, bugzilla is extremely difficult to search. I guess I'll post it again and worst case it will be closed as a duplicate.

Re: For those ready to take the challenge

2015-01-10 Thread bearophile via Digitalmars-d-learn
Adam D. Ruppe: Don't use git master :P Is the issue in Bugzilla? Bye, bearophile

Re: For those ready to take the challenge

2015-01-10 Thread Adam D. Ruppe via Digitalmars-d-learn
On Saturday, 10 January 2015 at 12:34:42 UTC, Tobias Pankrath wrote: Since it is a comparison of languages it's okay to match the original behaviour. I don't think this is really a great comparison of languages either though because it is gluing together a couple library tasks. Only a few bit

Re: For those ready to take the challenge

2015-01-10 Thread Adam D. Ruppe via Digitalmars-d-learn
On Saturday, 10 January 2015 at 13:22:57 UTC, Nordlöw wrote: on dmd git master. Ideas anyone? Don't use git master :P Definitely another regression. That line was just pushed to git like two weeks ago and the failing assertion is pretty obviously a pure dmd code bug, it doesn't know the leng

Re: For those ready to take the challenge

2015-01-10 Thread Nordlöw
On Friday, 9 January 2015 at 17:15:43 UTC, Adam D. Ruppe wrote: import arsd.dom; import std.net.curl; import std.stdio, std.algorithm; void main() { auto document = new Document(cast(string) get("http://www.stroustrup.com/C++.html";)); writeln(document.querySelectorAll("a[href]").map!

Re: For those ready to take the challenge

2015-01-10 Thread Tobias Pankrath via Digitalmars-d-learn
On Friday, 9 January 2015 at 17:18:43 UTC, Adam D. Ruppe wrote: Huh, looking at the answers on the website, they're mostly using regular expressions. Weaksauce. And wrong - they don't find ALL the links, they find the absolute HTTP urls! Since it is a comparison of languages it's okay to match

Re: For those ready to take the challenge

2015-01-10 Thread via Digitalmars-d-learn
On Friday, 9 January 2015 at 17:18:43 UTC, Adam D. Ruppe wrote: Huh, looking at the answers on the website, they're mostly using regular expressions. Weaksauce. And wrong - they don't find ALL the links, they find the absolute HTTP urls! Yeah... Surprising, since languages like python includes

Re: For those ready to take the challenge

2015-01-09 Thread Vladimir Panteleev via Digitalmars-d-learn
On Saturday, 10 January 2015 at 02:10:04 UTC, Jesse Phillips wrote: On Friday, 9 January 2015 at 13:50:29 UTC, eles wrote: https://codegolf.stackexchange.com/questions/44278/debunking-stroustrups-debunking-of-the-myth-c-is-for-large-complicated-pro Link to answer in D: http://codegolf.stackexc

Re: For those ready to take the challenge

2015-01-09 Thread Andrei Alexandrescu via Digitalmars-d-learn
On 1/9/15 6:10 PM, Jesse Phillips wrote: On Friday, 9 January 2015 at 13:50:29 UTC, eles wrote: https://codegolf.stackexchange.com/questions/44278/debunking-stroustrups-debunking-of-the-myth-c-is-for-large-complicated-pro Link to answer in D: http://codegolf.stackexchange.com/a/44417/13362

Re: For those ready to take the challenge

2015-01-09 Thread Jesse Phillips via Digitalmars-d-learn
On Friday, 9 January 2015 at 13:50:29 UTC, eles wrote: https://codegolf.stackexchange.com/questions/44278/debunking-stroustrups-debunking-of-the-myth-c-is-for-large-complicated-pro Link to answer in D: http://codegolf.stackexchange.com/a/44417/13362

Re: For those ready to take the challenge

2015-01-09 Thread Justin Whear via Digitalmars-d-learn
On Fri, 09 Jan 2015 17:18:42 +, Adam D. Ruppe wrote: > Huh, looking at the answers on the website, they're mostly using regular > expressions. Weaksauce. And wrong - they don't find ALL the links, they > find the absolute HTTP urls! Yes, I noticed that. `http://app.js"`>` isn't a "hyper

Re: For those ready to take the challenge

2015-01-09 Thread Adam D. Ruppe via Digitalmars-d-learn
On Friday, 9 January 2015 at 16:55:30 UTC, Justin Whear wrote: Was excited to give it a try, then remembered...std.xml :( Well, as the author of my dom.d, I think it counts as a first party library when I use it! --- import arsd.dom; import std.net.curl; import std.stdio, std.algorithm; v

Re: For those ready to take the challenge

2015-01-09 Thread Adam D. Ruppe via Digitalmars-d-learn
Huh, looking at the answers on the website, they're mostly using regular expressions. Weaksauce. And wrong - they don't find ALL the links, they find the absolute HTTP urls!

Re: For those ready to take the challenge

2015-01-09 Thread Justin Whear via Digitalmars-d-learn
On Fri, 09 Jan 2015 13:50:28 +, eles wrote: > https://codegolf.stackexchange.com/questions/44278/debunking- stroustrups-debunking-of-the-myth-c-is-for-large-complicated-pro Was excited to give it a try, then remembered...std.xml :(

For those ready to take the challenge

2015-01-09 Thread eles via Digitalmars-d-learn
https://codegolf.stackexchange.com/questions/44278/debunking-stroustrups-debunking-of-the-myth-c-is-for-large-complicated-pro