Re: ORM libraries for D

2015-09-25 Thread John Colvin via Digitalmars-d-learn
On Thursday, 24 September 2015 at 13:33:51 UTC, Rikki Cattermole wrote: On 25/09/15 1:30 AM, Edwin van Leeuwen wrote: On Thursday, 24 September 2015 at 13:24:14 UTC, Rikki Cattermole wrote: Dvorm is more or less feature complete :) I am the author of it, but unless issues come up I do not

Re: Dub package with C code

2015-09-25 Thread Laeeth Isharc via Digitalmars-d-learn
On Friday, 25 September 2015 at 15:08:00 UTC, bachmeier wrote: On Friday, 25 September 2015 at 15:06:41 UTC, bachmeier wrote: First issue would be getting approval from Walter and Andrei. Second would be finding someone that knows how to do it. Should I create a new thread to open discussion

Re: Dub package with C code

2015-09-25 Thread Laeeth Isharc via Digitalmars-d-learn
On Friday, 25 September 2015 at 12:25:52 UTC, tired_eyes wrote: I meant if there is already a place where I can upload my post to. Something like blog.dlang.org OT: Once again, I'm absolutely sure tha D should have an official blog! Forums can't replace blogs, forums are for discussions, not

Re: Dub package with C code

2015-09-25 Thread bachmeier via Digitalmars-d-learn
On Friday, 25 September 2015 at 14:24:36 UTC, Adam D. Ruppe wrote: FYI, if you guys want to set something up for multiple contributors like a traditional blog, I'm willing to move TWID do it. I've been kinda wanting to do a blog thing but I just haven't brought myself to set anything up.

Threading Questions

2015-09-25 Thread bitwise via Digitalmars-d-learn
Hey, I've got a few questions if anybody's got a minute. I'm trying to wrap my head around the threading situation in D. So far, things seem to be working as expected, but I want to verify my solutions. 1) Are the following two snippets exactly equivalent(not just in observable behaviour)?

Re: Dub package with C code

2015-09-25 Thread bachmeier via Digitalmars-d-learn
On Friday, 25 September 2015 at 15:06:41 UTC, bachmeier wrote: First issue would be getting approval from Walter and Andrei. Second would be finding someone that knows how to do it. Should I create a new thread to open discussion on the topic?

Capture characters from standard input without waiting for enter to be pressed

2015-09-25 Thread Martino via Digitalmars-d-learn
As subject, I'm trying to read from stdin without waiting for enter to be pressed. How can I do?

Re: ORM libraries for D

2015-09-25 Thread ZombineDev via Digitalmars-d-learn
On Thursday, 24 September 2015 at 13:18:58 UTC, David Nadlinger wrote: Hi all, I'm having a look at ORM libraries in D right now. So far, I've come across hibernated and dvorm. Are there any other libraries that I should have a look at, particularly actively maintained ones? dvorm and

Re: What is the corect behavour for lazy in foreach variadic template

2015-09-25 Thread Ali Çehreli via Digitalmars-d-learn
On 09/25/2015 05:56 AM, Sean Campbell wrote: Take the following code for example module test; import std.stdio; void test(T...)(lazy T args) I don't think that syntax is implemented. It looks valid to me though. There are many qualifier combinations that the compiler is silent about. I

Re: Deduplicating Template Parameter List of std.variant.Algebraic

2015-09-25 Thread Nordlöw via Digitalmars-d-learn
On Thursday, 24 September 2015 at 20:20:42 UTC, Nordlöw wrote: I just noticed that Algebraic doesn't deduplicate its types before construction because this compiles: import std.variant : Algebraic; auto x = Algebraic!(int, int)(5); Is this really sane? How can a template parameter

Re: Dub package with C code

2015-09-25 Thread Andre Polykanine via Digitalmars-d-learn
Hello tired_eyes, tevDdl> Once again, I'm absolutely sure tha D should have an official tevDdl> blog! Forums can't replace blogs, forums are for discussions, not tevDdl> for content presentation. +1 on this. -- With best regards from Ukraine, Andre

Re: pi program

2015-09-25 Thread Meta via Digitalmars-d-learn
On Friday, 25 September 2015 at 12:51:17 UTC, Russel Winder wrote: Aha, bingo, spot on. Thanks. Amended now to: double reduce_string_loop() { return reduce!"a + 1.0 / (b * b)"(iota(1, 100)); } double reduce_function_loop() { return reduce!((t, n) => t + 1.0 / (n *

Re: Capture characters from standard input without waiting for enter to be pressed

2015-09-25 Thread Ali Çehreli via Digitalmars-d-learn
On 09/25/2015 09:04 AM, Martino wrote: As subject, I'm trying to read from stdin without waiting for enter to be pressed. How can I do? One solution: http://forum.dlang.org/post/mailman.2665.1300747084.4748.digitalmars-d-le...@puremagic.com Ali

Re: What is the corect behavour for lazy in foreach variadic template

2015-09-25 Thread Artur Skawina via Digitalmars-d-learn
On 09/25/15 17:47, Ali Çehreli via Digitalmars-d-learn wrote: > Perhaps we need an enhancement that either works in your original code [...] His original code does work (`foreach` evaluates `args[N]` and assigns the result to `arg`). If he wanted to delay the evaluation, he would have written

Re: Capture characters from standard input without waiting for enter to be pressed

2015-09-25 Thread Steven Schveighoffer via Digitalmars-d-learn
On 9/25/15 12:04 PM, Martino wrote: As subject, I'm trying to read from stdin without waiting for enter to be pressed. How can I do? That is an issue with your terminal. You need to use a terminal configuration library to set it up to not buffer keystrokes until enter is pressed. I would

Re: Can I check if a value is convertible to a valid value of an enum?

2015-09-25 Thread Meta via Digitalmars-d-learn
On Friday, 25 September 2015 at 03:20:24 UTC, Nicholas Wilson wrote: find + EnumMembers should do the trick if ( (EnumMembers!SomeType).canFind(value)) { // ... } Should be if (only(EnumMembers!SomeType).canFind(value)) { //... }

Re: Deduplicating Template Parameter List of std.variant.Algebraic

2015-09-25 Thread Meta via Digitalmars-d-learn
On Friday, 25 September 2015 at 16:08:41 UTC, Nordlöw wrote: How can a template parameter list be deduplicated or sorted? You can use http://dlang.org/phobos/std_meta.html#.NoDuplicates. I imagine this was an oversight in the implementation of Algebraic.

Re: What is the corect behavour for lazy in foreach variadic template

2015-09-25 Thread Ali Çehreli via Digitalmars-d-learn
On 09/25/2015 09:38 AM, Artur Skawina via Digitalmars-d-learn wrote: On 09/25/15 17:47, Ali Çehreli via Digitalmars-d-learn wrote: Perhaps we need an enhancement that either works in your original code [...] His original code does work (`foreach` evaluates `args[N]` and assigns the result to

Re: Deduplicating Template Parameter List of std.variant.Algebraic

2015-09-25 Thread Nordlöw via Digitalmars-d-learn
On Friday, 25 September 2015 at 18:11:51 UTC, Meta wrote: You can use http://dlang.org/phobos/std_meta.html#.NoDuplicates. I imagine this was an oversight in the implementation of Algebraic. Thanks

Re: Threading Questions

2015-09-25 Thread bitwise via Digitalmars-d-learn
Pretty please? :)

Re: ORM libraries for D

2015-09-25 Thread Rikki Cattermole via Digitalmars-d-learn
On 26/09/15 3:03 AM, John Colvin wrote: On Thursday, 24 September 2015 at 13:33:51 UTC, Rikki Cattermole wrote: On 25/09/15 1:30 AM, Edwin van Leeuwen wrote: On Thursday, 24 September 2015 at 13:24:14 UTC, Rikki Cattermole wrote: Dvorm is more or less feature complete :) I am the author of

Can someone help me make a binary heap with std.container.binaryheap? It's not working... AssertError

2015-09-25 Thread Enjoys Math via Digitalmars-d-learn
Init: programResultsQ = heapify!(compareResults, Array!(Results!(O,I)))(Array!(Results!(O,I))([Results!(O,I)()]), 1); Decl: alias ProgramResultsQueue(O,I) = BinaryHeap!(Array!(Results!(O,I)), compareResults); Error: assert error in std.container.array.d (line 381) upon running.

Re: Dub package with C code

2015-09-25 Thread Sebastiaan Koppe via Digitalmars-d-learn
On Friday, 25 September 2015 at 06:04:09 UTC, Laeeth Isharc wrote: Blog platform - I guess nothing wrong with wordpress etc. I am between platforms right now. I just don't want to deal with wordpress any more, and haven't yet picked something I like better. Something like Nikola and

Re: pi program

2015-09-25 Thread Russel Winder via Digitalmars-d-learn
On Fri, 2015-09-25 at 06:02 +, Nicholas Wilson via Digitalmars-d -learn wrote: > On Friday, 25 September 2015 at 05:50:58 UTC, Charanjit Singh > wrote: > > import std.stdio; > > import std.math; > > void main() > > > > { > > float sum,pi,t; > > int n=1; > > sum=0; > > while

Re: Dub package with C code

2015-09-25 Thread tired_eyes via Digitalmars-d-learn
I meant if there is already a place where I can upload my post to. Something like blog.dlang.org OT: Once again, I'm absolutely sure tha D should have an official blog! Forums can't replace blogs, forums are for discussions, not for content presentation.

Re: pi program

2015-09-25 Thread John Colvin via Digitalmars-d-learn
On Friday, 25 September 2015 at 12:51:17 UTC, Russel Winder wrote: On Fri, 2015-09-25 at 09:14 +, mzf via Digitalmars-d-learn wrote: [...] Aha, bingo, spot on. Thanks. Amended now to: double reduce_string_loop() { return reduce!"a + 1.0 / (b * b)"(iota(1, 100)); }

Re: pi program

2015-09-25 Thread Russel Winder via Digitalmars-d-learn
On Fri, 2015-09-25 at 09:14 +, mzf via Digitalmars-d-learn wrote: > > If we worry about the string form and instead try: > > > > double reduce_string_loop() { > > return reduce!"1.0 / (a * a)"(iota(1, 100)); > > } > > > > double reduce_function_loop() { > > return reduce!((n) => 1.0

What is the corect behavour for lazy in foreach variadic template

2015-09-25 Thread Sean Campbell via Digitalmars-d-learn
Take the following code for example module test; import std.stdio; void test(T...)(lazy T args) { foreach(arg;args) //bar is invoked here { writeln("about to process arg"); writefln("processing arg %s",arg); //but it should be invoked here, right? } }

Re: pi program

2015-09-25 Thread Nicholas Wilson via Digitalmars-d-learn
On Friday, 25 September 2015 at 05:50:58 UTC, Charanjit Singh wrote: import std.stdio; import std.math; void main() { float sum,pi,t; int n=1; sum=0; while (n<100 ) { t=1/( n*n); n=n+1; sum=sum+t; } writeln("value of PI= " , (sum*6)^^.5); that is pi

Re: Dub package with C code

2015-09-25 Thread Laeeth Isharc via Digitalmars-d-learn
On Friday, 25 September 2015 at 01:48:57 UTC, Sebastiaan Koppe wrote: On Thursday, 24 September 2015 at 18:19:49 UTC, Laeeth Isharc wrote: nice work! To be honest it took me 2 hours, starting from git clone worth a little blog post on the experience so others can be inspired by and benefit

Re: final class & final methods

2015-09-25 Thread Marco Leise via Digitalmars-d-learn
Am Fri, 25 Sep 2015 10:28:54 + schrieb ref2401 : > If I declare a class as `final` do I have to mark all methods of > the class as `final` too? No. -- Marco

Re: final class & final methods

2015-09-25 Thread Mike Parker via Digitalmars-d-learn
On Friday, 25 September 2015 at 10:28:56 UTC, ref2401 wrote: If I declare a class as `final` do I have to mark all methods of the class as `final` too? A final class can't be subclassed, so none of its methods can be overridden anyway.

Re: pi program

2015-09-25 Thread mzfhhhh via Digitalmars-d-learn
If we worry about the string form and instead try: double reduce_string_loop() { return reduce!"1.0 / (a * a)"(iota(1, 100)); } double reduce_function_loop() { return reduce!((n) => 1.0 / (n * n))(iota(1, 100)); } it should be write : double reduce_loop() { //return iota(1,

Re: Dub package with C code

2015-09-25 Thread bachmeier via Digitalmars-d-learn
On Thursday, 24 September 2015 at 18:19:49 UTC, Laeeth Isharc wrote: On Thursday, 24 September 2015 at 02:43:20 UTC, Sebastiaan Koppe wrote: I have just created bindings for libxlsxwriter, an c library for creating excel files. Used the htod tool to do most of the work, and only had to

final class & final methods

2015-09-25 Thread ref2401 via Digitalmars-d-learn
If I declare a class as `final` do I have to mark all methods of the class as `final` too?

Re: Dub package with C code

2015-09-25 Thread bachmeier via Digitalmars-d-learn
On Friday, 25 September 2015 at 12:25:52 UTC, tired_eyes wrote: I meant if there is already a place where I can upload my post to. Something like blog.dlang.org OT: Once again, I'm absolutely sure tha D should have an official blog! Forums can't replace blogs, forums are for discussions, not

Re: Dub package with C code

2015-09-25 Thread Adam D. Ruppe via Digitalmars-d-learn
On Friday, 25 September 2015 at 14:15:20 UTC, bachmeier wrote: On Friday, 25 September 2015 at 12:25:52 UTC, tired_eyes wrote: Once again, I'm absolutely sure tha D should have an official blog! Forums can't replace blogs, forums are for discussions, not for content presentation. I've long