Re: Is https://tour.dlang.org under maintenance?

2018-01-26 Thread ChrisPiker via Digitalmars-d-learn
On Saturday, 27 January 2018 at 03:08:29 UTC, Seb wrote: The Dlang-Tour uses the web framework vibe.d (https://github.com/vibe-d/vibe.d). vibe.d currently uses libevent as underlying event library by default. Though with Well now libevent_pthreads is missing. Anyway, don't worry about it

Re: Further questions on interfacing to Postgres libpq

2018-01-26 Thread rikki cattermole via Digitalmars-d-learn
On 27/01/2018 5:11 AM, Joe wrote: An example test program that I'm using to learn D to C interfacing (specifically calling the libpq library) has a call to a C function declared as follows:     void PQprint(FILE *fout,  /* output stream */ const PGresult *res,  

Further questions on interfacing to Postgres libpq

2018-01-26 Thread Joe via Digitalmars-d-learn
An example test program that I'm using to learn D to C interfacing (specifically calling the libpq library) has a call to a C function declared as follows: void PQprint(FILE *fout, /* output stream */ const PGresult *res, const PQprintOpt *po);

Re: Help me understand how to contribute to bugs report / fixing

2018-01-26 Thread H. S. Teoh via Digitalmars-d-learn
On Fri, Jan 26, 2018 at 08:43:05PM +, Fra Mecca via Digitalmars-d-learn wrote: [...] > Pull request are done via git and bugs reported by the tracker. The > problem is when I want to understand if the bug of the tracker is > referenced in the repo of the organization and has an open PR. The

Re: Is https://tour.dlang.org under maintenance?

2018-01-26 Thread Seb via Digitalmars-d-learn
On Saturday, 27 January 2018 at 02:59:24 UTC, ChrisPiker wrote: BTW you can run the tour offline too: ``` git clone https://github.com/dlang-tour/core cd core git submodule foreach git pull origin master dub ``` Not that it's worth debugging since wget should get the job done The (offline)

Re: Is it possible to obtain textual representation of an arbitary code?

2018-01-26 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, January 26, 2018 14:23:20 Oleksii Skidan via Digitalmars-d-learn wrote: > On Friday, 26 January 2018 at 13:05:26 UTC, Jonathan M Davis > > wrote: > > Why are you using strings for any of this? Printing out the > > expression is kind of pointless. If you have the file and line > >

Re: Is https://tour.dlang.org under maintenance?

2018-01-26 Thread ChrisPiker via Digitalmars-d-learn
On Saturday, 27 January 2018 at 01:53:12 UTC, Seb wrote: It's still strange. Mind to open an issue and share screenshots here? https://github.com/dlang-tour/core/issues/new I just tried going there on a Mint 18 system running firefox 57.0.1 and everything loaded just fine. I'm hesitant to

Re: rdmd main.d leads to Segmentation fault

2018-01-26 Thread Fra Mecca via Digitalmars-d-learn
On Friday, 26 January 2018 at 22:40:29 UTC, Timoses wrote: Hey, simple hello world crashes with segfault: [...] Where did you get the D toolchain? Does the same segmentation fault happen with dmd or gdc or ldc? (dmd should be the more probable) Can you compile a dub project?

Re: Is https://tour.dlang.org under maintenance?

2018-01-26 Thread Seb via Digitalmars-d-learn
On Saturday, 27 January 2018 at 01:15:03 UTC, ChrisPiker wrote: On Friday, 26 January 2018 at 23:55:06 UTC, Seb wrote: No it's not on maintenance. I am not getting this error on neither Chrome or Firefox. See: https://imgur.com/a/wRhrw Oh good. Was a bit worried that it might be affecting

Re: Is https://tour.dlang.org under maintenance?

2018-01-26 Thread ChrisPiker via Digitalmars-d-learn
On Friday, 26 January 2018 at 23:55:06 UTC, Seb wrote: No it's not on maintenance. I am not getting this error on neither Chrome or Firefox. See: https://imgur.com/a/wRhrw Oh good. Was a bit worried that it might be affecting everyone. What Firefox version are you using? Anything specific

Re: Possible dmd 2.078 regression ?

2018-01-26 Thread timotheecour via Digitalmars-d-learn
On Friday, 12 January 2018 at 18:51:31 UTC, Basile B. wrote: On Friday, 12 January 2018 at 18:50:10 UTC, Basile B. wrote: On Friday, 12 January 2018 at 17:58:30 UTC, Stefan Koch wrote: On Friday, 12 January 2018 at 14:13:22 UTC, Basile B. wrote: I have a simple program that only compiles if

Re: Rewriting a c++ template to D (replacing iterator with ranges "properly")

2018-01-26 Thread Simen Kjærås via Digitalmars-d-learn
On Friday, 26 January 2018 at 15:33:03 UTC, aliak wrote: On Friday, 26 January 2018 at 14:35:25 UTC, Meta wrote: On Friday, 26 January 2018 at 14:16:04 UTC, aliak wrote: 1) I've seen some phobos code checking for assignability like this: is(typeof(range.front = false)) ... is that an

Re: Command Line Parsing

2018-01-26 Thread ChrisPiker via Digitalmars-d-learn
On Wednesday, 12 April 2017 at 10:58:07 UTC, Nicholas Wilson wrote: On Wednesday, 12 April 2017 at 09:51:34 UTC, Russel Winder wrote: Are Argon https://github.com/markuslaker/Argon or darg https://github. com/jasonwhite/darg getting traction as the default command line handling system for D

Is https://tour.dlang.org under maintenance?

2018-01-26 Thread ChrisPiker via Digitalmars-d-learn
I'm trying to learn D, but many of my site searches take me to https://tour.dlang.org, which cannot be displayed. Of course it may be a local problem (or it might not.) In case this is affecting anyone else, the error I'm getting from firefox is

Re: Is https://tour.dlang.org under maintenance?

2018-01-26 Thread Seb via Digitalmars-d-learn
On Friday, 26 January 2018 at 22:56:00 UTC, ChrisPiker wrote: I'm trying to learn D, but many of my site searches take me to https://tour.dlang.org, which cannot be displayed. Of course it may be a local problem (or it might not.) In case this is affecting anyone else, the error I'm getting

Re: Possible dmd 2.078 regression ?

2018-01-26 Thread Basile B. via Digitalmars-d-learn
On Friday, 26 January 2018 at 22:15:15 UTC, Basile B. wrote: On Friday, 26 January 2018 at 21:52:30 UTC, timotheecour wrote: On Friday, 12 January 2018 at 18:51:31 UTC, Basile B. wrote: On Friday, 12 January 2018 at 18:50:10 UTC, Basile B. wrote: On Friday, 12 January 2018 at 17:58:30 UTC,

Re: Possible dmd 2.078 regression ?

2018-01-26 Thread Basile B. via Digitalmars-d-learn
On Friday, 26 January 2018 at 21:52:30 UTC, timotheecour wrote: On Friday, 12 January 2018 at 18:51:31 UTC, Basile B. wrote: On Friday, 12 January 2018 at 18:50:10 UTC, Basile B. wrote: On Friday, 12 January 2018 at 17:58:30 UTC, Stefan Koch wrote: On Friday, 12 January 2018 at 14:13:22 UTC,

rdmd main.d leads to Segmentation fault

2018-01-26 Thread Timoses via Digitalmars-d-learn
Hey, simple hello world crashes with segfault: import std.stdio; void main() { writeln("hi"); } $ rdmd main.d Segmentation fault Same problem with a vibe.d project. Just set up this VirtualBox $ dmd --version DMD32 D Compiler v2.078.1 $ rdmd --version rdmd build 20180121 ... $ uname -a

Re: Help me understand how to contribute to bugs report / fixing

2018-01-26 Thread ag0aep6g via Digitalmars-d-learn
On 01/26/2018 09:43 PM, Fra Mecca wrote: Real world case: this bug has been reported recently: https://issues.dlang.org/show_bug.cgi?id=18288#add_comment [...] From a quick glance at the phobos repo, I found no mention of this bug in any closed or open PR, just a PR (#6056, bug 18280) on the

Re: Is it possible to obtain textual representation of an arbitary code?

2018-01-26 Thread timotheecour via Digitalmars-d-learn
On Friday, 26 January 2018 at 11:18:21 UTC, Oleksii Skidan wrote: Hi, I wonder if it's possible to convert D language code into a string at compile time? C/C++ preprocessor has this feature built-in: `#` preprocessing operator allows converting a macro argument into a string constant. See

Re: Help me understand how to contribute to bugs report / fixing

2018-01-26 Thread Simen Kjærås via Digitalmars-d-learn
On Friday, 26 January 2018 at 20:43:05 UTC, Fra Mecca wrote: What should I do now? I am undecided between: - commenting on the bug tracker and close the bug - link the pr 6056 on the bug tracker - leaving it be Leaving a comment on the bug with a link to the PR, and marking the bug resolved

Re: Is it possible to obtain textual representation of an arbitary code?

2018-01-26 Thread Oleksii Skidan via Digitalmars-d-learn
On Friday, 26 January 2018 at 13:25:12 UTC, Seb wrote: On Friday, 26 January 2018 at 13:05:26 UTC, Jonathan M Davis wrote: If you don't think that simply using assertions for unit tests is good enough, then I'd suggest that you look at https://code.dlang.org/packages/unit-threaded There's

Help me understand how to contribute to bugs report / fixing

2018-01-26 Thread Fra Mecca via Digitalmars-d-learn
Hi, I have been lurking in the bug tracker for some time, checking and trying to reproduce bugs and fixes. I finally want to submit something and contribute but I am having an hard time understanding the workflow. Pull request are done via git and bugs reported by the tracker. The problem

Re: Rewriting a c++ template to D (replacing iterator with ranges "properly")

2018-01-26 Thread Simen Kjærås via Digitalmars-d-learn
On Friday, 26 January 2018 at 14:16:04 UTC, aliak wrote: It basically steps through in a stride and sets the checkpoints to false. C++: template N> void mark(It begin, It end, N step) { assert(begin != end) *begin = false; while (end - begin > step) { begin = begin + step;

Strange compiler error. Whose bug is that?

2018-01-26 Thread Oleksii Skidan via Digitalmars-d-learn
Hi, I get a strange error: ``` λ dub build Performing "debug" build using D:\d\dmd2\windows\bin\dmd.exe for x86. strange ~master: building configuration "application"... source\app.d(24,18): Error: non-constant expression &[Particle(1.0F, 1.0F, 1.0F), Particle(2.0F,

Re: Rewriting a c++ template to D (replacing iterator with ranges "properly")

2018-01-26 Thread Meta via Digitalmars-d-learn
On Friday, 26 January 2018 at 14:16:04 UTC, aliak wrote: 1) I've seen some phobos code checking for assignability like this: is(typeof(range.front = false)) ... is that an advantage of that over hasAssignableElements? Or is that just basically combining constraints 3 and 4 which I have

Re: Class instance memory overhead lower than 3 words?

2018-01-26 Thread Steven Schveighoffer via Digitalmars-d-learn
On 1/24/18 4:48 PM, Nordlöw wrote: Why is the memory overhead for a class instance as high as 3 words (24 bytes on 64-bit systems? I find that annoyingly much for my knowledge database application. I'm aware of extern(C++), having one word overhead, but such extern(C++)-classes cannot use all

value of 'this' is not know at CT for typeof(this)

2018-01-26 Thread Dechcaudron via Digitalmars-d-learn
So I'm trying to get this to compile: ``` static foreach (alias member; getSymbolsByUDA!(typeof(this), Serialize)) serializeMember!member(bundle); ``` And I'm getting the following error: value of 'this' is not known at compile time for the line on top. typeof(this) to get the

Re: Rewriting a c++ template to D (replacing iterator with ranges "properly")

2018-01-26 Thread aliak via Digitalmars-d-learn
On Friday, 26 January 2018 at 14:59:09 UTC, Simen Kjærås wrote: what is N here? You're declaring it to be an int value in the template<> definition, and then use it as a type in the function definition. Oops again :) Should've been typename N (where N is some integral type). Not exactly.

Re: Rewriting a c++ template to D (replacing iterator with ranges "properly")

2018-01-26 Thread aliak via Digitalmars-d-learn
On Friday, 26 January 2018 at 14:35:25 UTC, Meta wrote: On Friday, 26 January 2018 at 14:16:04 UTC, aliak wrote: 1) I've seen some phobos code checking for assignability like this: is(typeof(range.front = false)) ... is that an advantage of that over hasAssignableElements? Or is that just

Re: value of 'this' is not know at CT for typeof(this)

2018-01-26 Thread Simen Kjærås via Digitalmars-d-learn
On Friday, 26 January 2018 at 20:08:19 UTC, Dechcaudron wrote: So I'm trying to get this to compile: ``` static foreach (alias member; getSymbolsByUDA!(typeof(this), Serialize)) serializeMember!member(bundle); ``` And I'm getting the following error: value of 'this' is not

Re: Is it possible to obtain textual representation of an arbitary code?

2018-01-26 Thread Oleksii Skidan via Digitalmars-d-learn
On Friday, 26 January 2018 at 13:05:26 UTC, Jonathan M Davis wrote: On Friday, January 26, 2018 12:30:03 Oleksii Skidan via Digitalmars-d-learn wrote: On Friday, 26 January 2018 at 11:32:42 UTC, Mike Parker wrote: > On Friday, 26 January 2018 at 11:18:21 UTC, Oleksii Skidan > > wrote: >> [...]

Re: Is it possible to obtain textual representation of an arbitary code?

2018-01-26 Thread Oleksii Skidan via Digitalmars-d-learn
On Friday, 26 January 2018 at 13:05:26 UTC, Jonathan M Davis wrote: Why are you using strings for any of this? Printing out the expression is kind of pointless. If you have the file and line number (which an AssertError will give you), then you know where the failure is, and you can see the

Re: Rewriting a c++ template to D (replacing iterator with ranges "properly")

2018-01-26 Thread aliak via Digitalmars-d-learn
On Friday, 26 January 2018 at 14:16:04 UTC, aliak wrote: range.front = false; while (!range.empty) { range.popFrontN(N); range.front = false; } } Oops, this should be: while (!range.empty) { range.front = false; range.popFrontN(N); }

Rewriting a c++ template to D (replacing iterator with ranges "properly")

2018-01-26 Thread aliak via Digitalmars-d-learn
It basically steps through in a stride and sets the checkpoints to false. C++: template void mark(It begin, It end, N step) { assert(begin != end) *begin = false; while (end - begin > step) { begin = begin + step; *begin = false; } } For D this is what I figured would be the

Re: Is it possible to obtain textual representation of an arbitary code?

2018-01-26 Thread Seb via Digitalmars-d-learn
On Friday, 26 January 2018 at 13:05:26 UTC, Jonathan M Davis wrote: If you don't think that simply using assertions for unit tests is good enough, then I'd suggest that you look at https://code.dlang.org/packages/unit-threaded There's also https://code.dlang.org/packages/fluent-asserts which

Re: Is it possible to obtain textual representation of an arbitary code?

2018-01-26 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, January 26, 2018 12:30:03 Oleksii Skidan via Digitalmars-d-learn wrote: > On Friday, 26 January 2018 at 11:32:42 UTC, Mike Parker wrote: > > On Friday, 26 January 2018 at 11:18:21 UTC, Oleksii Skidan > > > > wrote: > >> I could imagine a mixin-based solution in D: > >> ```d > >> //

Re: Is it possible to obtain textual representation of an arbitary code?

2018-01-26 Thread Basile B. via Digitalmars-d-learn
On Friday, 26 January 2018 at 11:32:42 UTC, Mike Parker wrote: On Friday, 26 January 2018 at 11:18:21 UTC, Oleksii Skidan wrote: I could imagine a mixin-based solution in D: ```d // Usage: ASSERT!"a == b"; ``` But it seems a bit alien to me. First of all, it kind of stringly-typed one.

Re: MapViewOfFileEx: Not enough storage is available to process this command.

2018-01-26 Thread rikki cattermole via Digitalmars-d-learn
On 26/01/2018 12:32 PM, Andre Pany wrote: On Friday, 26 January 2018 at 12:19:10 UTC, rikki cattermole wrote: Could be heap fragmentation to who knows what else assuming of course this is 32bit right? If so, 64bit is the answer. Thanks for the hint. 64bit solves the issue. Should I anyway

Re: Is it possible to obtain textual representation of an arbitary code?

2018-01-26 Thread Oleksii Skidan via Digitalmars-d-learn
On Friday, 26 January 2018 at 11:32:42 UTC, Mike Parker wrote: On Friday, 26 January 2018 at 11:18:21 UTC, Oleksii Skidan wrote: I could imagine a mixin-based solution in D: ```d // Usage: ASSERT!"a == b"; ``` But it seems a bit alien to me. First of all, it kind of stringly-typed one.

Re: MapViewOfFileEx: Not enough storage is available to process this command.

2018-01-26 Thread Andre Pany via Digitalmars-d-learn
On Friday, 26 January 2018 at 12:19:10 UTC, rikki cattermole wrote: Could be heap fragmentation to who knows what else assuming of course this is 32bit right? If so, 64bit is the answer. Thanks for the hint. 64bit solves the issue. Should I anyway create an issue? Kind regards André

Re: MapViewOfFileEx: Not enough storage is available to process this command.

2018-01-26 Thread rikki cattermole via Digitalmars-d-learn
On 26/01/2018 12:16 PM, Andre Pany wrote: Hi, in my application I create a zip archive with a size of ~ 400 MB and after that I read the archive. While trying to read the archive, there is an error: std.windows.syserror.WindowsException@std\mmfile.d(267): MapViewOfFileEx: Not enough

MapViewOfFileEx: Not enough storage is available to process this command.

2018-01-26 Thread Andre Pany via Digitalmars-d-learn
Hi, in my application I create a zip archive with a size of ~ 400 MB and after that I read the archive. While trying to read the archive, there is an error: std.windows.syserror.WindowsException@std\mmfile.d(267): MapViewOfFileEx: Not enough storage is available to process this command.

Re: Is it possible to obtain textual representation of an arbitary code?

2018-01-26 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, January 26, 2018 11:32:42 Mike Parker via Digitalmars-d-learn wrote: > On Friday, 26 January 2018 at 11:18:21 UTC, Oleksii Skidan wrote: > > I could imagine a mixin-based solution in D: > > ```d > > // Usage: > > ASSERT!"a == b"; > > ``` > > But it seems a bit alien to me. First of

Re: Is it possible to obtain textual representation of an arbitary code?

2018-01-26 Thread Mike Parker via Digitalmars-d-learn
On Friday, 26 January 2018 at 11:18:21 UTC, Oleksii Skidan wrote: I could imagine a mixin-based solution in D: ```d // Usage: ASSERT!"a == b"; ``` But it seems a bit alien to me. First of all, it kind of stringly-typed one. Secondly, neither IDEs nor advanced text editors are able to figure

Re: Is it possible to obtain textual representation of an arbitary code?

2018-01-26 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, January 26, 2018 11:18:21 Oleksii Skidan via Digitalmars-d-learn wrote: > Hi, > > I wonder if it's possible to convert D language code into a > string at compile time? C/C++ preprocessor has this feature > built-in: `#` preprocessing operator allows converting a macro > argument into a

Is it possible to obtain textual representation of an arbitary code?

2018-01-26 Thread Oleksii Skidan via Digitalmars-d-learn
Hi, I wonder if it's possible to convert D language code into a string at compile time? C/C++ preprocessor has this feature built-in: `#` preprocessing operator allows converting a macro argument into a string constant. See the following code snippet for example: ```cplusplus #define