Re: Merging one Array with Another

2015-05-06 Thread via Digitalmars-d-learn
On Wednesday, 6 May 2015 at 16:05:15 UTC, Andrea Fontana wrote: Maybe a way like this could be useful: http://dpaste.dzfl.pl/7b4b37b490a7 If r is a SortedRange this is very unneccesary wasteful because of the use AA. In that case you, instead, only want to remove equal consequtive elements

Re: vibed: how to use pure HTML instead of template engine?

2015-05-06 Thread Dicebot via Digitalmars-d-learn
On Wednesday, 6 May 2015 at 20:45:10 UTC, John Colvin wrote: On Wednesday, 6 May 2015 at 14:28:26 UTC, Adam D. Ruppe wrote: On Wednesday, 6 May 2015 at 14:23:27 UTC, Chris wrote: Especially this: http://vibed.org/templates/diet#embedded-code I think that's a misfeature... if I used vibe.d, I'

Re: vibed: how to use pure HTML instead of template engine?

2015-05-06 Thread John Colvin via Digitalmars-d-learn
On Wednesday, 6 May 2015 at 14:28:26 UTC, Adam D. Ruppe wrote: On Wednesday, 6 May 2015 at 14:23:27 UTC, Chris wrote: Especially this: http://vibed.org/templates/diet#embedded-code I think that's a misfeature... if I used vibe.d, I'd want to avoid the diet too. I quite like them. Obviously

Re: Linker command

2015-05-06 Thread Paul via Digitalmars-d-learn
On Wednesday, 6 May 2015 at 20:03:36 UTC, anonymous wrote: On Wednesday, 6 May 2015 at 19:52:44 UTC, Paul wrote: On Wednesday, 6 May 2015 at 19:30:33 UTC, anonymous wrote: On Wednesday, 6 May 2015 at 19:26:40 UTC, Paul wrote: but I don't understand the syntax. dmd --help mentions -Llinkerflag

Re: Linker command

2015-05-06 Thread anonymous via Digitalmars-d-learn
On Wednesday, 6 May 2015 at 19:52:44 UTC, Paul wrote: On Wednesday, 6 May 2015 at 19:30:33 UTC, anonymous wrote: On Wednesday, 6 May 2015 at 19:26:40 UTC, Paul wrote: but I don't understand the syntax. dmd --help mentions -Llinkerflag but what is '-L-L.' doing?? Passes '-L.' to the linker.

Re: Linker command

2015-05-06 Thread Justin Whear via Digitalmars-d-learn
On Wed, 06 May 2015 19:52:42 +, Paul wrote: > On Wednesday, 6 May 2015 at 19:30:33 UTC, anonymous wrote: >> On Wednesday, 6 May 2015 at 19:26:40 UTC, Paul wrote: >>> but I don't understand the syntax. dmd --help mentions -Llinkerflag >>> but what is '-L-L.' doing?? >> >> Passes '-L.' to the li

Re: Linker command

2015-05-06 Thread Paul via Digitalmars-d-learn
On Wednesday, 6 May 2015 at 19:52:44 UTC, Paul wrote: On Wednesday, 6 May 2015 at 19:30:33 UTC, anonymous wrote: On Wednesday, 6 May 2015 at 19:26:40 UTC, Paul wrote: but I don't understand the syntax. dmd --help mentions -Llinkerflag but what is '-L-L.' doing?? Passes '-L.' to the linker.

Re: Linker command

2015-05-06 Thread Paul via Digitalmars-d-learn
On Wednesday, 6 May 2015 at 19:30:33 UTC, anonymous wrote: On Wednesday, 6 May 2015 at 19:26:40 UTC, Paul wrote: but I don't understand the syntax. dmd --help mentions -Llinkerflag but what is '-L-L.' doing?? Passes '-L.' to the linker. :D I can see that, but what does '-L.' mean exactly?

Re: vibed: how to use pure HTML instead of template engine?

2015-05-06 Thread Chris via Digitalmars-d-learn
On Wednesday, 6 May 2015 at 18:52:41 UTC, Suliman wrote: auto html = someStringActions(); res.writeBody(cast(ubyte[])html); Thanks, but how to attach to html css file? Now page is loading, but do not handle css that also placed in this folder. CSS should be exported automatically when you us

Re: Linker command

2015-05-06 Thread Paul via Digitalmars-d-learn
On Wednesday, 6 May 2015 at 12:41:21 UTC, wobbles wrote: On Monday, 4 May 2015 at 20:34:32 UTC, Paul wrote: Can some one tell me what this linker command means (or point me at some docs) please: dmd example.d -L-L. $@ AFAIK $@ is 'all the supplied arguments' so I don't understand what it ach

Re: Linker command

2015-05-06 Thread anonymous via Digitalmars-d-learn
On Wednesday, 6 May 2015 at 19:26:40 UTC, Paul wrote: but I don't understand the syntax. dmd --help mentions -Llinkerflag but what is '-L-L.' doing?? Passes '-L.' to the linker.

Re: vibed: how to use pure HTML instead of template engine?

2015-05-06 Thread Suliman via Digitalmars-d-learn
And how people write in jade if it's impossible to preview page without compiling it's to HTML?

Re: vibed: how to use pure HTML instead of template engine?

2015-05-06 Thread Suliman via Digitalmars-d-learn
auto html = someStringActions(); res.writeBody(cast(ubyte[])html); Thanks, but how to attach to html css file? Now page is loading, but do not handle css that also placed in this folder.

Re: Efficiently passing structs

2015-05-06 Thread Ali Çehreli via Digitalmars-d-learn
On 05/06/2015 11:24 AM, Charles Hixson via Digitalmars-d-learn wrote: On 05/05/2015 11:49 AM, Ali Çehreli via Digitalmars-d-learn wrote: On 05/05/2015 07:14 AM, bitwise wrote: > I don't see how someone could arrive at the above > solution without showing up here and asking first. It was the

Re: Efficiently passing structs

2015-05-06 Thread Charles Hixson via Digitalmars-d-learn
On 05/05/2015 11:49 AM, Ali Çehreli via Digitalmars-d-learn wrote: On 05/05/2015 07:14 AM, bitwise wrote: > I don't see how someone could arrive at the above > solution without showing up here and asking first. It was the same with me. :) Then I wrote a short section about it: http://ddili.

Re: Merging one Array with Another

2015-05-06 Thread Andrea Fontana via Digitalmars-d-learn
On Friday, 1 May 2015 at 19:08:51 UTC, Per Nordlöw wrote: What's the fastest Phobos-way of doing either x ~= y; // append x = x.uniq; // remove duplicates or x = (x ~ y).uniq; // append and remove duplicates in one go provided that T[] x, y; ? Maybe a way like this could b

Re: dub sub-packages

2015-05-06 Thread Rikki Cattermole via Digitalmars-d-learn
On 6/05/2015 11:39 p.m., Alessandro wrote: Hi everyone, I've been learning D for a few months now and really liked it :) ! Currently I'm experimenting with client/server application development using the ZeroMQ library D wrapper called "zmqd". Although I could successfully build the basic hello_w

Re: vibed: how to use pure HTML instead of template engine?

2015-05-06 Thread Chris via Digitalmars-d-learn
On Wednesday, 6 May 2015 at 14:28:26 UTC, Adam D. Ruppe wrote: On Wednesday, 6 May 2015 at 14:23:27 UTC, Chris wrote: Especially this: http://vibed.org/templates/diet#embedded-code I think that's a misfeature... if I used vibe.d, I'd want to avoid the diet too. I have never used the templat

Re: vibed: how to use pure HTML instead of template engine?

2015-05-06 Thread Andrea Fontana via Digitalmars-d-learn
On Wednesday, 6 May 2015 at 14:28:26 UTC, Adam D. Ruppe wrote: On Wednesday, 6 May 2015 at 14:23:27 UTC, Chris wrote: Especially this: http://vibed.org/templates/diet#embedded-code I think that's a misfeature... if I used vibe.d, I'd want to avoid the diet too. I agree

Re: vibed: how to use pure HTML instead of template engine?

2015-05-06 Thread Adam D. Ruppe via Digitalmars-d-learn
You can put that dynamic data in regular HTML too as long as you generate it on the server. I imagine vibe.d must support some kind of raw output write function, if you find that, you can make your html then just write it out as a string.

Re: vibed: how to use pure HTML instead of template engine?

2015-05-06 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 6 May 2015 at 14:23:27 UTC, Chris wrote: Especially this: http://vibed.org/templates/diet#embedded-code I think that's a misfeature... if I used vibe.d, I'd want to avoid the diet too.

Re: Signs by which to recognize D1

2015-05-06 Thread rumbu via Digitalmars-d-learn
On Wednesday, 6 May 2015 at 07:56:53 UTC, Daren Scot Wilson wrote: Someone looks at a chunk of D code of murky origin. Possibly, it is old, maybe D1 not D2. Inadequately commented, believe it or not, and not other information. What are some easy to spot details in the syntax by which the on

Re: vibed: how to use pure HTML instead of template engine?

2015-05-06 Thread Chris via Digitalmars-d-learn
On Wednesday, 6 May 2015 at 14:07:09 UTC, Suliman wrote: I mean that I know that template can be changes dynamically, but I thought that 99% of dynamic is javascript code... Templates are like PHP, JSP, LSP etc. They can do stuff on the server side via embedded D code, load files for example.

Re: vibed: how to use pure HTML instead of template engine?

2015-05-06 Thread Chris via Digitalmars-d-learn
On Wednesday, 6 May 2015 at 14:21:24 UTC, Chris wrote: On Wednesday, 6 May 2015 at 14:07:09 UTC, Suliman wrote: I mean that I know that template can be changes dynamically, but I thought that 99% of dynamic is javascript code... Templates are like PHP, JSP, LSP etc. They can do stuff on the s

Re: vibed: how to use pure HTML instead of template engine?

2015-05-06 Thread Alex Parrill via Digitalmars-d-learn
On Wednesday, 6 May 2015 at 14:07:09 UTC, Suliman wrote: I mean that I know that template can be changes dynamically, but I thought that 99% of dynamic is javascript code... What if the user has Javascript disabled, or is using some client that doesn't execute Javascript (spiders and crawlers,

Re: vibed: how to use pure HTML instead of template engine?

2015-05-06 Thread Suliman via Digitalmars-d-learn
I mean that I know that template can be changes dynamically, but I thought that 99% of dynamic is javascript code...

Re: vibed: how to use pure HTML instead of template engine?

2015-05-06 Thread Suliman via Digitalmars-d-learn
You want to serve html files instead of templates, right? It should be something like Yeah, I do not see any profits with using templates right now. Explain me if I am wrong.

Re: vibed: how to use pure HTML instead of template engine?

2015-05-06 Thread Chris via Digitalmars-d-learn
On Wednesday, 6 May 2015 at 13:50:04 UTC, Chris wrote: On Wednesday, 6 May 2015 at 13:32:48 UTC, Suliman wrote: By default vibed use Diet. Maybe it's cool, but for me it's easier to write in pure HTML. What is the best way to do it? You want to serve html files instead of templates, right? It

Re: vibed: how to use pure HTML instead of template engine?

2015-05-06 Thread Chris via Digitalmars-d-learn
On Wednesday, 6 May 2015 at 13:32:48 UTC, Suliman wrote: By default vibed use Diet. Maybe it's cool, but for me it's easier to write in pure HTML. What is the best way to do it? You want to serve html files instead of templates, right? It should be something like router.get("*", serveStaticF

vibed: how to use pure HTML instead of template engine?

2015-05-06 Thread Suliman via Digitalmars-d-learn
By default vibed use Diet. Maybe it's cool, but for me it's easier to write in pure HTML. What is the best way to do it?

Re: Linker command

2015-05-06 Thread wobbles via Digitalmars-d-learn
On Monday, 4 May 2015 at 20:34:32 UTC, Paul wrote: Can some one tell me what this linker command means (or point me at some docs) please: dmd example.d -L-L. $@ AFAIK $@ is 'all the supplied arguments' so I don't understand what it achieves. (it's from the DAllegro5 example program, on Linu

dub sub-packages

2015-05-06 Thread Alessandro via Digitalmars-d-learn
Hi everyone, I've been learning D for a few months now and really liked it :) ! Currently I'm experimenting with client/server application development using the ZeroMQ library D wrapper called "zmqd". Although I could successfully build the basic hello_world application with a custom written Makef

Re: Signs by which to recognize D1

2015-05-06 Thread weaselcat via Digitalmars-d-learn
On Wednesday, 6 May 2015 at 07:56:53 UTC, Daren Scot Wilson wrote: Someone looks at a chunk of D code of murky origin. Possibly, it is old, maybe D1 not D2. Inadequately commented, believe it or not, and not other information. What are some easy to spot details in the syntax by which the on

Signs by which to recognize D1

2015-05-06 Thread Daren Scot Wilson via Digitalmars-d-learn
Someone looks at a chunk of D code of murky origin. Possibly, it is old, maybe D1 not D2. Inadequately commented, believe it or not, and not other information. What are some easy to spot details in the syntax by which the onlooker can know it's D1 not D2?

Re: CTFE & template predicates

2015-05-06 Thread via Digitalmars-d-learn
template startsNotWith(string s,char c){ enum startsNotWith = s.length == 0 || s[0] != c; } Better still: enum startsNotWith(string s, char c) = { return s.length == 0 || s[0] != c; }