Re: Parallel foreach over AliasSec?

2017-02-26 Thread Bastiaan Veelo via Digitalmars-d-learn
On Monday, 27 February 2017 at 02:02:57 UTC, ag0aep6g wrote: Make a range or an array of function pointers from the AliasSeq of function aliases: import std.meta: staticMap; import std.range: only; enum fptr(alias f) = enum fptrs = staticMap!(fptr, funcs); auto r = only(fptrs); foreach

How to specify --arch option in dub.json

2017-02-26 Thread mogu via Digitalmars-d-learn
I use dub 1.2.1 to build my project. As convenience, I choose `dflags-windows-x86: ["-m32mscoff"]` option in dub.json of my library binding to specify default architecture in win32 platform. But in the newest dub release, this cause a warning which told me to use DLFAGS environment or specify

Re: trick to make throwing method @nogc

2017-02-26 Thread Guest via Digitalmars-d-learn
On Saturday, 25 February 2017 at 19:59:29 UTC, ikod wrote: Hello, I have a method for range: struct Range { immutable(ubyte[]) _buffer; size_t _pos; @property void popFront() pure @safe { enforce(_pos < _buffer.length, "popFront from empty buffer");

Re: Parallel foreach over AliasSec?

2017-02-26 Thread ag0aep6g via Digitalmars-d-learn
On 02/27/2017 01:35 AM, Bastiaan Veelo wrote: template eval_all(funcs...) { void eval_all(int val) { import std.parallelism; //foreach (i, f; parallel(funcs))// Tries to evaluate f(void) foreach (i, f; funcs)// How do I parallelise this?

Parallel foreach over AliasSec?

2017-02-26 Thread Bastiaan Veelo via Digitalmars-d-learn
Hi, Is it possible to parallelise the iteration over an AliasSec? Ordinary parallel foreach does not work. I have tried submitting tasks to taskPool in an ordinary foreach, but I can't because i cannot be read at compile time. int one(int) {return 1;} int two(int) {return 2;} int three(int)

Re: code D'ish enough? - ignore previous post with same subject

2017-02-26 Thread ag0aep6g via Digitalmars-d-learn
On Sunday, 26 February 2017 at 19:34:33 UTC, thorstein wrote: // Reads CSV-like files with only numeric values in each column // new_ndv replaces ndv, which is the original no-data-value double[][]* readNumMatCsv(char[] filePath, int numHeaderLines, char[] ndv, char[] new_ndv) *

Re: Can't rending DT template

2017-02-26 Thread WebFreak001 via Digitalmars-d-learn
On Sunday, 26 February 2017 at 12:22:01 UTC, Suliman wrote: I have this code: module pages; import vibe.d; import database; import vibe.web.web; class MyPages { @path("/page1") void getPage() { render!("home.dt"); } } The error: https://snag.gy/PtNeSs.jpg Error: template

code D'ish enough? - ignore previous post with same subject

2017-02-26 Thread thorstein via Digitalmars-d-learn
Hi, sorry for posting again, but I used a keyboard combination that accidently send my post before it was done. Coming more or less from Python I just started with D. Not a real programmer, just automating things and looking for a neat compiled language. Just to learn, I wrote a function

code D'ish enough?

2017-02-26 Thread thorstein via Digitalmars-d-learn
Hi, coming more or less from Python I just started with D. Not a real programmer, just automating things and looking for a neat compiled language. Just to learn, I wrote a function to read CSV-like files (I know D has its own routine). Since I'm still a bit overwhelmed by the many complex

Re: ddoc: Can I escape a colon?

2017-02-26 Thread Alexandru Ermicioi via Digitalmars-d-learn
On Thursday, 23 February 2017 at 21:04:39 UTC, Nick Sabalausky (Abscissa) wrote: Suppose I want ddoc output to include this line: -- Note: Blah blabbety blah -- But the colon causes "Note" to be considered a section header. Is there a way to escape the ":" so that it's

Re: Can't rending DT template

2017-02-26 Thread Suliman via Digitalmars-d-learn
On Sunday, 26 February 2017 at 12:31:21 UTC, Suliman wrote: It's look like wrong error, because project is buildable. So I have only one question. Can I do response not in .dt, but in .html? It's seems that serveStaticFiles is only one normal way to get it work.

Re: Can't rending DT template

2017-02-26 Thread Suliman via Digitalmars-d-learn
It's look like wrong error, because project is buildable. So I have only one question. Can I do response not in .dt, but in .html?

Can't rending DT template

2017-02-26 Thread Suliman via Digitalmars-d-learn
I have this code: module pages; import vibe.d; import database; import vibe.web.web; class MyPages { @path("/page1") void getPage() { render!("home.dt"); } } The error: https://snag.gy/PtNeSs.jpg Error: template instance vibe.web.web.render!"home.dt".render!("pages",