DLang MongoDB Drive ??

2013-08-07 Thread Batuhan Göksu
d to make MongoDB database connection data extraction, data, how do I do want to add friends would appreciate if you help me in this regard.

Re: D web/server app hosting

2013-08-07 Thread nazriel
On Tuesday, 6 August 2013 at 11:58:37 UTC, Luís Marques wrote: Are you developing Web / server applications in D? Where are you hosting them? Your own servers? AWS? Linode? Etc. What would you recommend? How do you manage app versioning and deployment? For instance, AWS Beanstalk seems to be

Re: Phobos and older DMD versions

2013-08-07 Thread Jesse Phillips
On Wednesday, 7 August 2013 at 19:13:13 UTC, Andre Artus wrote: You should be able to run side-by-side installations of dmd+phobos, at least that is how I do it. One latest stable, one built from GitHub source. That isn't related to what I'm trying to describe. dmd2.063 program.d dmd

Re: Evangelizing Your Cool Product

2013-08-07 Thread eles
On Wednesday, 7 August 2013 at 17:09:16 UTC, Dicebot wrote: On Wednesday, 7 August 2013 at 17:01:36 UTC, Borislav Kosharov I personally just avoid using them at all. That's the danger that roots in the lack of clarity. And, I cannot blame people outside thinking along the same lines about the

Re: Evangelizing Your Cool Product

2013-08-07 Thread eles
On Wednesday, 7 August 2013 at 14:12:32 UTC, eles wrote: On Wednesday, 7 August 2013 at 02:27:42 UTC, Walter Bright wrote: On 8/6/2013 4:28 PM, MattCoder wrote: What I perceived: language should state on those several ambiguous issues (@property was quoted, complex numbers) and tools should ge

ctRegex! vs regex error

2013-08-07 Thread Milvakili
Hi, I can compile void main(){ auto myRegx = regex(`(?!test)`); } however can not compile this one void main(){ auto myRegx = ctRegex!(`(?!test)`); } code sample:http://dpaste.dzfl.pl/d38926f4 and get the following error: /opt/compilers/dmd2/include/std/regex.d(4355): Error: "NeglookaheadS

Re: database applications

2013-08-07 Thread John Joyus
On 08/06/2013 04:55 PM, Carlos wrote: It is called GtkD. Are there any applications written with GtkD for Windows? Just want to look at the screen shots. Thanks.

Re: Guys, what have I done xD

2013-08-07 Thread Meta
On Wednesday, 7 August 2013 at 19:52:13 UTC, Borislav Kosharov wrote: I played around and used D's flexible syntax and I managed to create this: https://gist.github.com/nikibobi/6169035 It prints the song's lyrics and I have used aliases, templates, constants, the fact that f(a) == a.f() == a.

Re: std.array string.split("") bug

2013-08-07 Thread H. S. Teoh
On Wed, Aug 07, 2013 at 01:42:13PM -0700, H. S. Teoh wrote: > On Wed, Aug 07, 2013 at 10:39:11PM +0200, John Colvin wrote: > > On Wednesday, 7 August 2013 at 19:10:11 UTC, Borislav Kosharov > > wrote: > > >Something strange happens when I do this: > > > > > >unittest { > > >import std.array, st

Re: std.array string.split("") bug

2013-08-07 Thread H. S. Teoh
On Wed, Aug 07, 2013 at 10:39:11PM +0200, John Colvin wrote: > On Wednesday, 7 August 2013 at 19:10:11 UTC, Borislav Kosharov > wrote: > >Something strange happens when I do this: > > > >unittest { > >import std.array, std.string; > >string s = "test"; > >//assert(s.toUpper.split("").jo

Re: std.array string.split("") bug

2013-08-07 Thread John Colvin
On Wednesday, 7 August 2013 at 19:10:11 UTC, Borislav Kosharov wrote: Something strange happens when I do this: unittest { import std.array, std.string; string s = "test"; //assert(s.toUpper.split("").join("-") == "T-E-S-T"); //"Memory allocation failed" //[Finished in 26.5s]

Maybe add init template to std.conv?

2013-08-07 Thread Borislav Kosharov
I have created 2 probably useful and short templates that enhance .init ///Returns Source's .init converted with std.conv.to to Target @property auto init(Source, Target)() { return init!Source.to!Target; } ///Sets target to Source's .init value @property void init(Source, Target)(out Targe

Re: std.array string.split("") bug

2013-08-07 Thread H. S. Teoh
On Wed, Aug 07, 2013 at 12:44:54PM -0700, H. S. Teoh wrote: > On Wed, Aug 07, 2013 at 09:10:04PM +0200, Borislav Kosharov wrote: > > Something strange happens when I do this: > > > > unittest { > > import std.array, std.string; > > string s = "test"; > > //assert(s.toUpper.split("").jo

Re: Guys, what have I done xD

2013-08-07 Thread Brad Anderson
On Wednesday, 7 August 2013 at 19:55:48 UTC, Borislav Kosharov wrote: On Wednesday, 7 August 2013 at 19:54:32 UTC, Brad Anderson wrote: On Wednesday, 7 August 2013 at 19:52:13 UTC, Borislav Kosharov wrote: I played around and used D's flexible syntax and I managed to create this: https://gist.

Re: Guys, what have I done xD

2013-08-07 Thread Borislav Kosharov
On Wednesday, 7 August 2013 at 19:54:32 UTC, Brad Anderson wrote: On Wednesday, 7 August 2013 at 19:52:13 UTC, Borislav Kosharov wrote: I played around and used D's flexible syntax and I managed to create this: https://gist.github.com/nikibobi/6169035 It prints the song's lyrics and I have use

Re: Guys, what have I done xD

2013-08-07 Thread H. S. Teoh
On Wed, Aug 07, 2013 at 09:52:10PM +0200, Borislav Kosharov wrote: > I played around and used D's flexible syntax and I managed to create > this: > https://gist.github.com/nikibobi/6169035 > > It prints the song's lyrics and I have used aliases, templates, > constants, the fact that f(a) == a.f()

Re: Guys, what have I done xD

2013-08-07 Thread Brad Anderson
On Wednesday, 7 August 2013 at 19:52:13 UTC, Borislav Kosharov wrote: I played around and used D's flexible syntax and I managed to create this: https://gist.github.com/nikibobi/6169035 It prints the song's lyrics and I have used aliases, templates, constants, the fact that f(a) == a.f() == a.

Guys, what have I done xD

2013-08-07 Thread Borislav Kosharov
I played around and used D's flexible syntax and I managed to create this: https://gist.github.com/nikibobi/6169035 It prints the song's lyrics and I have used aliases, templates, constants, the fact that f(a) == a.f() == a.f and many more small things. I tough that it was funny and strange an

Re: std.array string.split("") bug

2013-08-07 Thread H. S. Teoh
On Wed, Aug 07, 2013 at 09:10:04PM +0200, Borislav Kosharov wrote: > Something strange happens when I do this: > > unittest { > import std.array, std.string; > string s = "test"; > //assert(s.toUpper.split("").join("-") == "T-E-S-T"); > //"Memory allocation failed" > //[Finishe

Re: Phobos and older DMD versions

2013-08-07 Thread Jacob Carlborg
On 2013-08-07 21:13, Andre Artus wrote: You should be able to run side-by-side installations of dmd+phobos, at least that is how I do it. One latest stable, one built from GitHub source. DVM is a great way to do that: https://github.com/jacob-carlborg/dvm -- /Jacob Carlborg

Re: Phobos and older DMD versions

2013-08-07 Thread Andre Artus
On Wednesday, 7 August 2013 at 18:37:22 UTC, Jesse Phillips wrote: On Tuesday, 6 August 2013 at 22:23:03 UTC, Andrei Alexandrescu wrote: I think it should be fair to require the new compiler with the new stdlib. They are released in unison. Andrei I agree, but there is at least potential ben

std.array string.split("") bug

2013-08-07 Thread Borislav Kosharov
Something strange happens when I do this: unittest { import std.array, std.string; string s = "test"; //assert(s.toUpper.split("").join("-") == "T-E-S-T"); //"Memory allocation failed" //[Finished in 26.5s] //CPU: 1% -> 50% | 2.7GHz dual core //RAM: 1.6GB -> 2.6GB | 1G

Re: Phobos and older DMD versions

2013-08-07 Thread Jesse Phillips
On Tuesday, 6 August 2013 at 22:23:03 UTC, Andrei Alexandrescu wrote: I think it should be fair to require the new compiler with the new stdlib. They are released in unison. Andrei I agree, but there is at least potential benefits from choosing previous compiler version. If a change in compi

Re: std.mmfile

2013-08-07 Thread Jonathan M Davis
On Wednesday, August 07, 2013 10:18:14 H. S. Teoh wrote: > I'm looking into std.mmfile for one of my new D projects, and I'm > concerned about its API: there is no way to explicit unmap the file?? > The docs say it will be unmapped when deleted, but isn't the delete > operator deprecated? And the G

std.mmfile

2013-08-07 Thread H. S. Teoh
I'm looking into std.mmfile for one of my new D projects, and I'm concerned about its API: there is no way to explicit unmap the file?? The docs say it will be unmapped when deleted, but isn't the delete operator deprecated? And the GC does not guarantee class dtors will ever get called. So how wou

Re: Evangelizing Your Cool Product

2013-08-07 Thread Dicebot
On Wednesday, 7 August 2013 at 14:12:32 UTC, eles wrote: What I perceived: language should state on those several ambiguous issues (@property was quoted, complex numbers) and tools should get some maturity (the .so thing for one). I think it is a very important moment that is often underestim

Re: Evangelizing Your Cool Product

2013-08-07 Thread Dicebot
On Wednesday, 7 August 2013 at 17:01:36 UTC, Borislav Kosharov wrote: Yea, I don't like how you have to write properties in D. I usually write them like this: @property { int myNum() { return _myNum; } void myNum(int value) { _myNum = value; } } I saw that in the

Re: Finding the path to a executable?

2013-08-07 Thread H. S. Teoh
On Wed, Aug 07, 2013 at 12:55:10PM -0400, Nick Sabalausky wrote: > On Wed, 07 Aug 2013 09:13:03 +0200 > "Tommi" wrote: > > > On Wednesday, 7 August 2013 at 05:31:24 UTC, Alan wrote: > > > Hello! This may seem like a simple question, maybe an > > > embarassing question but how would I fetch the

Re: Evangelizing Your Cool Product

2013-08-07 Thread Borislav Kosharov
On Wednesday, 7 August 2013 at 14:12:32 UTC, eles wrote: On Wednesday, 7 August 2013 at 02:27:42 UTC, Walter Bright wrote: On 8/6/2013 4:28 PM, MattCoder wrote: It simply isn't enough to create a great product. I did try. At my job. Basically, answers that I received were like: "it's unfinish

Re: Finding the path to a executable?

2013-08-07 Thread Nick Sabalausky
On Wed, 07 Aug 2013 09:13:03 +0200 "Tommi" wrote: > On Wednesday, 7 August 2013 at 05:31:24 UTC, Alan wrote: > > Hello! This may seem like a simple question, maybe an > > embarassing question but how would I fetch the absolute path to > > the directory where my executable is located? My wordi

Re: atomicLoad/Store

2013-08-07 Thread John Colvin
On Monday, 5 August 2013 at 20:22:37 UTC, zyhong wrote: From my understanding, any data type that is less than 32bit (bool, char, int, etc) is atomic and there is no need to use atomicLoad/Store and read/write the data to be thread safe. In std.parallelism, I saw it use atomicLoad/Store for any

Re: atomicLoad/Store

2013-08-07 Thread zyhong
thanks for all the answers. they are very helpful. d community is just too good.

Re: Sorting array with different order

2013-08-07 Thread bearophile
Grzeogorz Łuszczek: I will be glad if someone could help me with my problem. Such questions are better asked in D.learn newsgroup. Every time you instantiate the sort function with different template arguments, you generate a different type. So you could use a variant, or probably better to

Re: Question on Interface.

2013-08-07 Thread JS
On Wednesday, 7 August 2013 at 07:11:58 UTC, SteveGuo wrote: I like the concept of interface, It enforces its successors to implement some necessary methods. Please take a look at the following example: device.d - interface device { // I want the three methods i

Re: Evangelizing Your Cool Product

2013-08-07 Thread eles
On Wednesday, 7 August 2013 at 02:27:42 UTC, Walter Bright wrote: On 8/6/2013 4:28 PM, MattCoder wrote: It simply isn't enough to create a great product. I did try. At my job. Basically, answers that I received were like: "it's unfinished." (they meant language is changing and tools are immat

Re: Phobos and older DMD versions

2013-08-07 Thread Dicebot
On Tuesday, 6 August 2013 at 14:51:35 UTC, qznc wrote: My recent pull request [0] triggered some issue, which should get a bigger discussion: Should Phobos version N also compile with DMD N-1? In my opinion it should, because it makes Phobos development simpler. You don't need a self compiled

Sorting array with different order

2013-08-07 Thread Grzeogorz Łuszczek
I'm writing small web server to serve data as JSON. This data could be sorted based on various parameters (order and field to sort). In this example I will use only 2 classes (but I need serve 10-20 classes and each class have 5-10 attributes): class Port { int number; Host[] host; } cl

Re: Future of string lambda functions/string predicate functions

2013-08-07 Thread Dicebot
I kind of loved old string lambdas in std.algorithm and was against introduction of new shorter lambda syntax. Still not convinced by the change but keeping both does not make sense for sure. So, yes, string lambdas should be deprecated and normal ones patches to support all remaining use cases

Re: Question on Interface.

2013-08-07 Thread SteveGuo
As mentioned by evilrat earlier the 'string signature' should probably be made a readonly property, set in the constructor. I don't think D supports defining a constructor signature on interfaces (I could be wrong), so you want to define an invariant as part of the contract. You may also wan

Re: Evangelizing Your Cool Product

2013-08-07 Thread Wyatt
On Tuesday, 6 August 2013 at 23:28:44 UTC, MattCoder wrote: I don't think you should just compare programmers/developers with entrepreneurs like you did. Of course there are programmers who market/promote their own software, but most don't or at least not like an entrepreneur would do. Mayb

Re: Phobos and older DMD versions

2013-08-07 Thread Andrej Mitrovic
On 8/7/13, monarch_dodra wrote: > It's not just about new features in DMD that phobos wants to use. > dmd bugs are fixed for phobos, I'd say, on a twice by week basis > (roughly). Yep. Backwards compatibility would be nice but currently we just can't afford it. But as far as I know isn't this the

Re: Future of string lambda functions/string predicate functions

2013-08-07 Thread Jakob Ovrum
On Wednesday, 7 August 2013 at 11:16:05 UTC, Timon Gehr wrote: I think the way to go for these cases is to fix the parser. I'd be very happy with such a change, but to my understanding, it's not just a parser issue. Perhaps a DIP that describes exactly how alias should work and what it should

Re: Future of string lambda functions/string predicate functions

2013-08-07 Thread Dejan Lekic
On Tuesday, 6 August 2013 at 09:05:57 UTC, Jakob Ovrum wrote: In Phobos pull request #1453 (Implement chunkBy.)[1], the topic of string lambda functions has again cropped up. I think we should clearly decide on some things regarding them. Questions such as; are they a worthwhile alternative in

Re: Future of string lambda functions/string predicate functions

2013-08-07 Thread Timon Gehr
On 08/07/2013 06:18 AM, Jakob Ovrum wrote: On Tuesday, 6 August 2013 at 19:38:08 UTC, Meta wrote: Looks good except for the above point. UnaryFun and binaryFun still have valid use cases, and I'd argue that it's even worth making an nAryFun!(pred, arity). import std.functional; import std.stdio

Re: Finding the path to a executable?

2013-08-07 Thread Jacob Carlborg
On 2013-08-07 07:31, Alan wrote: Hello! This may seem like a simple question, maybe an embarassing question but how would I fetch the absolute path to the directory where my executable is located? My wording is known to be confusing so I will give an example: cd ~/projects/program dmd Program.

Re: Future of string lambda functions/string predicate functions

2013-08-07 Thread Jakob Ovrum
On Wednesday, 7 August 2013 at 10:03:58 UTC, Jakob Ovrum wrote: All the following functionally equivalent string lambdas will produce different instantiations of Sorter: "a > b" "b < a" "a Oops, accidentally reversed it there. Correction: "a > b" "b < a" "a>b" "

Re: Future of string lambda functions/string predicate functions

2013-08-07 Thread Jakob Ovrum
On Wednesday, 7 August 2013 at 09:12:41 UTC, monarch_dodra wrote: Also, and this is important (!): A lambda is *always unique*, whereas strings alias each other. This means that: sort!"a > b"(1, 2, 3); //Both generate the same template sort!"a > b"(1, 2, 3); // sort!((a, b) => a > b)(1, 2, 3);

Re: Future of string lambda functions/string predicate functions

2013-08-07 Thread Peter Alexander
On Wednesday, 7 August 2013 at 09:12:41 UTC, monarch_dodra wrote: Since the end coder is not a D guru, he'll have no idea which functions do support string lambdas, and which don't, which will leave him in an eternal guessing game of "well, looks like *that* doesn't compile"... String lambdas

Re: Question on Interface.

2013-08-07 Thread Andre Artus
On Wednesday, 7 August 2013 at 08:18:43 UTC, SteveGuo wrote: what? O_o let me explain, abstract class requires its successors to implement all methods, but may have fields. class successors *always* do something, either their methods has derived behavior or overridden ones. so does interface, i

Re: Phobos and older DMD versions

2013-08-07 Thread monarch_dodra
On Tuesday, 6 August 2013 at 14:51:35 UTC, qznc wrote: My recent pull request [0] triggered some issue, which should get a bigger discussion: Should Phobos version N also compile with DMD N-1? In my opinion it should, because it makes Phobos development simpler. You don't need a self compiled

Re: Future of string lambda functions/string predicate functions

2013-08-07 Thread monarch_dodra
On Tuesday, 6 August 2013 at 21:35:05 UTC, John Colvin wrote: On Tuesday, 6 August 2013 at 20:28:59 UTC, Peter Alexander wrote: On Tuesday, 6 August 2013 at 09:05:57 UTC, Jakob Ovrum wrote: Specifically, I suggest the following deprecation path: * Add deprecation notes to std.functional's unar

Re: Compiling DMD with C++11

2013-08-07 Thread Andre Artus
On Wednesday, 7 August 2013 at 08:18:26 UTC, David Nadlinger wrote: On Tuesday, 6 August 2013 at 22:58:21 UTC, Andre Artus wrote: Okay. I already changed those in my copy. Just out of interest: what would be an acceptable name to change 'strtold' to? strtold is a C standard library function,

Re: Finding the path to a executable?

2013-08-07 Thread Manfred Nowak
evilrat wrote: > in theory should always return actual program path Which theory? Especially in heteromorphic systems there is no such thing like a unique path between two accessible "points" in a file system. -manfred

Re: Compiling DMD with C++11

2013-08-07 Thread David Nadlinger
On Tuesday, 6 August 2013 at 22:58:21 UTC, Andre Artus wrote: Okay. I already changed those in my copy. Just out of interest: what would be an acceptable name to change 'strtold' to? strtold is a C standard library function, but due to the portability problems the actual compiler code should

Re: Question on Interface.

2013-08-07 Thread SteveGuo
what? O_o let me explain, abstract class requires its successors to implement all methods, but may have fields. class successors *always* do something, either their methods has derived behavior or overridden ones. so does interface, if you has class derived from interface then its successors ma

Re: Question on Interface.

2013-08-07 Thread evilrat
On Wednesday, 7 August 2013 at 07:30:52 UTC, SteveGuo wrote: if D would allow this - what is then the difference between a class with your methods as virtuals + your string? interface are for loosier coupling then classes - thats why only declerations not implementations (like your string) are

Re: Question on Interface.

2013-08-07 Thread SteveGuo
if D would allow this - what is then the difference between a class with your methods as virtuals + your string? interface are for loosier coupling then classes - thats why only declerations not implementations (like your string) are allowed, same goes to Java and C# (and i think most other i

Re: Question on Interface.

2013-08-07 Thread evilrat
On Wednesday, 7 August 2013 at 07:11:58 UTC, SteveGuo wrote: I like the concept of interface, It enforces its successors to implement some necessary methods. Please take a look at the following example: device.d - interface device { // I want the three methods i

Re: Question on Interface.

2013-08-07 Thread dennis luehring
Am 07.08.2013 09:11, schrieb SteveGuo: I like the concept of interface, It enforces its successors to implement some necessary methods. Please take a look at the following example: device.d - interface device { // I want the three methods implemented by its succe

Re: Finding the path to a executable?

2013-08-07 Thread Tommi
...sorry, add import std.path; if you need the last two functions.

Re: Finding the path to a executable?

2013-08-07 Thread Tommi
On Wednesday, 7 August 2013 at 05:31:24 UTC, Alan wrote: Hello! This may seem like a simple question, maybe an embarassing question but how would I fetch the absolute path to the directory where my executable is located? My wording is known to be confusing so I will give an example: cd ~/pr

Question on Interface.

2013-08-07 Thread SteveGuo
I like the concept of interface, It enforces its successors to implement some necessary methods. Please take a look at the following example: device.d - interface device { // I want the three methods implemented by its successors void PowerOn(); void Powe