0.3572695 Look Inside And Realize That Dream ... 8.830667E-03
5.414706E-02 Look Inside And Realize That Dream ... 0.4493563 0.3572695 Now Visit http://www.clicklinknow.com/dating/ 8.830667E-03
Re: any framework or tips for multi-tier applications
Qian Xu wrote: Hi All, We are redesigning a system (previously was written in C) using D. We use Boundary-Controll-Entity-Pattern. To wrap db table to entities is a very time consuming work. Is there any framework or tips for multi-tier applications in D? --Qian At times like this, I think of this blog post: http://ayende.com/Blog/archive/2008/03/11/Field-Expedients-or-why-I-dont-have-the-tools-is.aspx You can likely write some mixins to ease the use of Active Record. That would be the first thing I'd try. The simplest version I can imagine would either not work for relations: template Member(T, char[] name) { enum Member = T.stringof ~ ` ` ~ name ~ `() { return row.get!(` ~ T.stringof ~ `)(` ~ name ~ `); }`; } /* table Foo a INT, b BIT, c TEXT */ class Foo { private Row row; this (Row row) { this.row = row; } mixin (Member!(int, "a")); mixin (Member!(bool, "b")); mixin (Member!(char[], "c")); }
Re: -profile and threaded code
BCS wrote: > Hello BCS, > >> I have a program that runs an "easily" parallelizable loop. When I run >> it as a single thread it only takes about 10% longer than 2 threads >> (on a dual-core). I'm trying to track down the lossed time and am >> wondering if turning on -profile is even worth looking at. The concern >> is that it might not be thread safe or might just skew the result so >> much as to be useless. >> > > Well it seems that runing threded code with -profile gives a seg-v. So I > guess that answers that. > > Try GDC. :)
Re: -profile and threaded code
Hello BCS, I have a program that runs an "easily" parallelizable loop. When I run it as a single thread it only takes about 10% longer than 2 threads (on a dual-core). I'm trying to track down the lossed time and am wondering if turning on -profile is even worth looking at. The concern is that it might not be thread safe or might just skew the result so much as to be useless. Well it seems that runing threded code with -profile gives a seg-v. So I guess that answers that.
-profile and threaded code
I have a program that runs an "easily" parallelizable loop. When I run it as a single thread it only takes about 10% longer than 2 threads (on a dual-core). I'm trying to track down the lossed time and am wondering if turning on -profile is even worth looking at. The concern is that it might not be thread safe or might just skew the result so much as to be useless.
Re: const argument
Le Sat, 28 Mar 2009 12:21:52 +0100, Jarrett Billingsley a écrit: On Sat, Mar 28, 2009 at 6:12 AM, TSalm wrote: Hello, Is there a way to specifie a constant argument ( I would say an argument for which his value is evaluate at compile time ) For example, something like this : /* CODE - */ import tango.io.Stdout; void func(const bool constArg) { static if (constArg) Stdout("Yes").newline; else Stdout("No").newline; } void main() { func( true ); func( false ); } /* END CODE - */ You have to do it with templates: void func(bool constArg)() { static if(constArg) ... else ... } func!(true)(); func!(false)(); Thanks. Walter suggested, in the D2 presentation at the conference in 2007, that there should be "static" parameters which would work the way your code should work. good idea IMO.
any framework or tips for multi-tier applications
Hi All, We are redesigning a system (previously was written in C) using D. We use Boundary-Controll-Entity-Pattern. To wrap db table to entities is a very time consuming work. Is there any framework or tips for multi-tier applications in D? --Qian
Re: const argument
On Sat, Mar 28, 2009 at 6:12 AM, TSalm wrote: > Hello, > > Is there a way to specifie a constant argument ( I would say an argument for > which his value is evaluate at compile time ) > > For example, something like this : > > /* CODE - */ > import tango.io.Stdout; > > void func(const bool constArg) > { > static if (constArg) > Stdout("Yes").newline; > else > Stdout("No").newline; > } > > void main() > { > func( true ); > func( false ); > } > /* END CODE - */ You have to do it with templates: void func(bool constArg)() { static if(constArg) ... else ... } func!(true)(); func!(false)(); Walter suggested, in the D2 presentation at the conference in 2007, that there should be "static" parameters which would work the way your code should work.
const argument
Hello, Is there a way to specifie a constant argument ( I would say an argument for which his value is evaluate at compile time ) For example, something like this : /* CODE - */ import tango.io.Stdout; void func(const bool constArg) { static if (constArg) Stdout("Yes").newline; else Stdout("No").newline; } void main() { func( true ); func( false ); } /* END CODE - */ Thanks in advance, TSalm