Re: D outperformed by C++, what am I doing wrong?

2017-08-12 Thread Roman Hargrave via Digitalmars-d-learn
On Sunday, 13 August 2017 at 06:09:39 UTC, amfvcg wrote: Hi all, I'm solving below task: given container T and value R return sum of R-ranges over T. An example: input : T=[1,1,1] R=2 output : [2, 1] input : T=[1,2,3] R=1 output : [1,2,3] (see dlang unittests for more examples) Below c++ co

Re: D outperformed by C++, what am I doing wrong?

2017-08-12 Thread rikki cattermole via Digitalmars-d-learn
On 13/08/2017 7:09 AM, amfvcg wrote: Hi all, I'm solving below task: given container T and value R return sum of R-ranges over T. An example: input : T=[1,1,1] R=2 output : [2, 1] input : T=[1,2,3] R=1 output : [1,2,3] (see dlang unittests for more examples) Below c++ code compiled with g++-5

D outperformed by C++, what am I doing wrong?

2017-08-12 Thread amfvcg via Digitalmars-d-learn
Hi all, I'm solving below task: given container T and value R return sum of R-ranges over T. An example: input : T=[1,1,1] R=2 output : [2, 1] input : T=[1,2,3] R=1 output : [1,2,3] (see dlang unittests for more examples) Below c++ code compiled with g++-5.4.0 -O2 -std=c++14 runs on my mach

Re: Does anyone understand how to use "shared" types with concurrency send/receive functions?

2017-08-12 Thread crimaniak via Digitalmars-d-learn
On Saturday, 12 August 2017 at 18:57:44 UTC, Arek wrote: I have the folowing problem: I like to envelope the class object in struct to control the destruction moment and then send this object to another thread/fiber (or task, cause I use vibe-d). I can't find any method to make it working. An

Re: html fetcher/parser

2017-08-12 Thread Soulsbane via Digitalmars-d-learn
On Saturday, 12 August 2017 at 19:53:22 UTC, Faux Amis wrote: I would like to get into D again by making a small program which fetches a website every X-time and keeps track of all changes within specified dom elements. fetching: should I go for std curl, vibe.d or something else? parsing: I c

Re: html fetcher/parser

2017-08-12 Thread Michael via Digitalmars-d-learn
On Saturday, 12 August 2017 at 20:22:44 UTC, Adam D. Ruppe wrote: On Saturday, 12 August 2017 at 19:53:22 UTC, Faux Amis wrote: [...] My dom.d and http2.d combine to make this easy: https://github.com/adamdruppe/arsd/blob/master/dom.d https://github.com/adamdruppe/arsd/blob/master/http2.d [.

Re: html fetcher/parser

2017-08-12 Thread Adam D. Ruppe via Digitalmars-d-learn
On Saturday, 12 August 2017 at 19:53:22 UTC, Faux Amis wrote: I would like to get into D again by making a small program which fetches a website every X-time and keeps track of all changes within specified dom elements. My dom.d and http2.d combine to make this easy: https://github.com/adamdr

html fetcher/parser

2017-08-12 Thread Faux Amis via Digitalmars-d-learn
I would like to get into D again by making a small program which fetches a website every X-time and keeps track of all changes within specified dom elements. fetching: should I go for std curl, vibe.d or something else? parsing: I could only find these dub packages: htmld & libdominator. And th

Does anyone understand how to use "shared" types with concurrency send/receive functions?

2017-08-12 Thread Arek via Digitalmars-d-learn
I have the folowing problem: I like to envelope the class object in struct to control the destruction moment and then send this object to another thread/fiber (or task, cause I use vibe-d). I can't find any method to make it working. Any ideas? dmd (version 075) gives so stupid results, I bel

Re: How to make http requests to unix socket?

2017-08-12 Thread Sebastiaan Koppe via Digitalmars-d-learn
On Friday, 11 August 2017 at 18:39:54 UTC, dvnguyen wrote: How to make http requests to unix socket? For example, in Docker engine api, curl --unix-socket /var/run/docker.sock http:/v1.24/containers/json I made a pull request a year ago or so to have vibe-d's requestHttp to support unix soc

Re: __dtor vs __xdtor

2017-08-12 Thread Marco Leise via Digitalmars-d-learn
Am Fri, 11 Aug 2017 17:10:14 + schrieb bitwise : > Ok thanks. > > I don't understand why you would ever want to call __dtor > then...is it possible to have only __dtor without also having > __xdtor? Like, if I want to call a struct's destructor, do I have > to check for both, or can I just

ddoc and method overriding.

2017-08-12 Thread Alexandru Ermicioi via Digitalmars-d-learn
Hi all, Having a trivial example such as: ```D class Foo { /** * A documentation info **/ void fancy(); } class Moo { override void fancy(); } ``` Is there a way to tell ddoc to use Foo.fancy documentation block for overriding Moo.fancy method? Thx.