Re: DFL is the best UIcontrols for D,compare it to dwt, tkd,dtk,dlangui,anchovy......

2014-05-12 Thread FrankLike via Digitalmars-d-learn
On Tuesday, 13 May 2014 at 06:24:27 UTC, Jacob Carlborg wrote: On 13/05/14 02:10, FrankLike wrote: 1.DFL's Memory Usage is the least than other. winsamp.exe is 2.1M,DFL's example's exe is 2.7M. 2.The size of DFL's example's exe files is the least than other, and only a single file. 3.DFL's so

Re: How to make sure GC allocated resources stay around when used in C functions?

2014-05-12 Thread Kagamin via Digitalmars-d-learn
Another option is to allocate from pool.

Re: naming a variable at runtime

2014-05-12 Thread Jacob Carlborg via Digitalmars-d-learn
On 13/05/14 06:32, InfinityPlusB wrote: yup, that will work. If I wasn't hell bent on naming variables, I probably would have figured this out. :P Perhaps you could use an associative array. Then you get sort of named variables. -- /Jacob Carlborg

Re: How to make sure GC allocated resources stay around when used in C functions?

2014-05-12 Thread Kagamin via Digitalmars-d-learn
Do you always bind all of them?

Re: DFL is the best UIcontrols for D, compare it to dwt, tkd, dtk, dlangui, anchovy......

2014-05-12 Thread Jacob Carlborg via Digitalmars-d-learn
On 13/05/14 02:10, FrankLike wrote: 1.DFL's Memory Usage is the least than other. winsamp.exe is 2.1M,DFL's example's exe is 2.7M. 2.The size of DFL's example's exe files is the least than other, and only a single file. 3.DFL's source code is the most easy to understand. Although DFL not use on

Re: Templating everything? One module per function/struct/class/etc, grouped by package?

2014-05-12 Thread Jacob Carlborg via Digitalmars-d-learn
On 12/05/14 20:58, Francesco Cattoglio wrote: Error messages! If your code is not compiled, you can't know whether it is valid or not. I must say that since we have unittests, this is somewhat less relevant, but still... One nice thing would be stripping the executable of unneeded code. One tri

How to use the 'ExecuteShell','execv','execvp' open the 'forum.dlang.org'?

2014-05-12 Thread FrankLike via Digitalmars-d-learn
If you offen open the 'forum.dlang.org',always want to open the web quickly, but how to use the 'ExecuteShell','execv','execvp' open the 'forum.dlang.org'? module main; import std.process,std.stdio; void main() { const string[] urls =["http://localhost:8080";]; const string

Re: Messy code in console

2014-05-12 Thread Ali Çehreli via Digitalmars-d-learn
On 05/12/2014 09:53 PM, IceNature via Digitalmars-d-learn wrote: > I've just thought of a problem. Others who uses my program on their > computers needs to change their setting. It is a bit troublesome. It is also possible to set the code page when the program is running: http://forum.dlang.or

Re: Messy code in console

2014-05-12 Thread IceNature via Digitalmars-d-learn
I've just thought of a problem. Others who uses my program on their computers needs to change their setting. It is a bit troublesome. On 2014年5月11日 格林尼治标准时间+0800下午3时43分41秒, FrankLike via Digitalmars-d-learn wrote: >On Sunday, 11 May 2014 at 06:35:26 UTC, IceNature via >Digitalmars-d-learn wrot

Re: naming a variable at runtime

2014-05-12 Thread InfinityPlusB via Digitalmars-d-learn
On Tuesday, 13 May 2014 at 04:26:04 UTC, Ali Çehreli wrote: On 05/12/2014 08:47 PM, InfinityPlusB wrote: > I want to be able to name the rows, as they are built. First, no, you cannot name variables at run time because variables are concepts of source code; they don't exist in the compiled pr

Re: naming a variable at runtime

2014-05-12 Thread Ali Çehreli via Digitalmars-d-learn
On 05/12/2014 08:47 PM, InfinityPlusB wrote: > I want to be able to name the rows, as they are built. First, no, you cannot name variables at run time because variables are concepts of source code; they don't exist in the compiled program. > So when row 1 is read in I get > int[] bob_1 = new

Re: naming a variable at runtime

2014-05-12 Thread InfinityPlusB via Digitalmars-d-learn
On Tuesday, 13 May 2014 at 03:54:33 UTC, safety0ff wrote: You should look into associative arrays ( http://dlang.org/hash-map .) Example: import std.stdio; void main() { int[][string] mybobs; mybobs["bob_1"] = [-1, -1, 1, -1, -1]; mybobs["bob_2"] = [-1, 1, 1, 1, -1];

Re: naming a variable at runtime

2014-05-12 Thread safety0ff via Digitalmars-d-learn
You should look into associative arrays ( http://dlang.org/hash-map .) Example: import std.stdio; void main() { int[][string] mybobs; mybobs["bob_1"] = [-1, -1, 1, -1, -1]; mybobs["bob_2"] = [-1, 1, 1, 1, -1]; mybobs["bob_3"] = [-1, 1, 1, 1, -1]; writeln

naming a variable at runtime

2014-05-12 Thread InfinityPlusB via Digitalmars-d-learn
Hi clever people I'm trying to do something which I thought would be easy. Read a file in, and for every row, create a array. I want to be able to name the rows, as they are built. So when row 1 is read in I get int[] bob_1 = new int[0]; when the second row is read in, I get int[] bob_2 = new in

Re: Recommendation on option parsing

2014-05-12 Thread Chris Piker via Digitalmars-d-learn
On Monday, 12 May 2014 at 23:11:57 UTC, Robert Schadek via Digitalmars-d-learn wrote: Chris please help to make this happen https://github.com/D-Programming-Language/phobos/pull/2072 I'm not sure what you are asking for. Would you like me to tryout getoptEx? yes please test it Okay, I rep

Re: why can't I call const methods on shared objects?

2014-05-12 Thread Vlad Levenfeld via Digitalmars-d-learn
@FreeSlave & John Colvin Yes, I see your point. I could still get tearing on a read. So, in the case of methods that I believe are safe (e.g. 1-line @property getters) I'll just write a shared variadic function template that uses (cast()this).foo(args) to forward to the non-shared method... a

Re: Decoding HTML escape sequences

2014-05-12 Thread Adam D. Ruppe via Digitalmars-d-learn
You should use decodeComponent instead of decode in your matchAll loop. IMO encodeComponent and decodeComponent are the only two useful uri encode functions (btw same in JS, use decodeURIComponent instead of the other functions). The other ones have weird rules.

DFL is the best UIcontrols for D,compare it to dwt, tkd,dtk,dlangui,anchovy......

2014-05-12 Thread FrankLike via Digitalmars-d-learn
1.DFL's Memory Usage is the least than other. winsamp.exe is 2.1M,DFL's example's exe is 2.7M. 2.The size of DFL's example's exe files is the least than other, and only a single file. 3.DFL's source code is the most easy to understand. Although DFL not use on Linux or Mac os X,it's easy to do f

Re: Recommendation on option parsing

2014-05-12 Thread Robert Schadek via Digitalmars-d-learn
On 05/12/2014 10:44 PM, Chris Piker via Digitalmars-d-learn wrote: > On Saturday, 10 May 2014 at 11:59:03 UTC, Robert Schadek via > Digitalmars-d-learn wrote: >> On 05/10/2014 01:09 AM, Chris Piker via Digitalmars-d-learn wrote: >>> Phobos' std.getopt is a bit spare for my taste, as there is >>> no

Decoding HTML escape sequences

2014-05-12 Thread Hugo Florentino via Digitalmars-d-learn
Hi, I have some documents where some strings appears in HTML escape sequences in one of these forms: \x3C\x53\x43\x52\x49\x50\x54\x20\x4C\x41\x4E\x47\x55\x41\x47\x45\x3D\x22\x4A\x61\x76\x61\x53\x63\x72\x69\x70\x74\x22\x3e %3C%53%43%52%49%50%54%20%4C%41%4E%47%55%41%47%45%3D%22%4A%61%76%61%53%63%

Re: How to make sure GC allocated resources stay around when used in C functions?

2014-05-12 Thread Gary Willoughby via Digitalmars-d-learn
On Monday, 12 May 2014 at 20:03:46 UTC, Kagamin wrote: Why many? I'd say, you typically have 0 subscriptions (label, textbox) per widget, seldom - 1 (button, combobox, checkbox). There are many events that can be bound to on any widget. https://github.com/nomad-software/tkd/blob/master/source/t

Re: Recommendation on option parsing

2014-05-12 Thread Chris Piker via Digitalmars-d-learn
On Saturday, 10 May 2014 at 09:50:04 UTC, Jacob Carlborg wrote: On 2014-05-10 01:09, Chris Piker wrote: Phobos' std.getopt is a bit spare for my taste, as there is no builtin general help facility with word-wrapping. ... I'm using the one in Tango [1] with some additions [2]. It's a bit messy

Re: Recommendation on option parsing

2014-05-12 Thread Chris Piker via Digitalmars-d-learn
On Saturday, 10 May 2014 at 11:59:03 UTC, Robert Schadek via Digitalmars-d-learn wrote: On 05/10/2014 01:09 AM, Chris Piker via Digitalmars-d-learn wrote: Phobos' std.getopt is a bit spare for my taste, as there is no builtin general help facility with word-wrapping. ... -- Chris please help to

Re: newbie question about variables in slices..

2014-05-12 Thread Jonathan M Davis via Digitalmars-d-learn
On Mon, 12 May 2014 20:12:41 + Kai via Digitalmars-d-learn wrote: > Hi I am trying to iterate over a mmfile (ubyte[]) and convert it > to uint > > void main(){ > MmFile inn = new MmFile("mmData.dat"); > ubyte[] arr = cast(ubyte[])inn[]; > for(ulong index = 0; index ulong stop = in

newbie question about variables in slices..

2014-05-12 Thread Kai via Digitalmars-d-learn
Hi I am trying to iterate over a mmfile (ubyte[]) and convert it to uint void main(){ MmFile inn = new MmFile("mmData.dat"); ubyte[] arr = cast(ubyte[])inn[]; for(ulong index = 0; indexError: template std.bitmanip.littleEndianToNative cannot deduce function from argument

Re: How to make sure GC allocated resources stay around when used in C functions?

2014-05-12 Thread Kagamin via Digitalmars-d-learn
combobox and checkbox usually don't require a subscription either. Only button requires a reaction from your code, everything else usually works on its own.

Re: How to make sure GC allocated resources stay around when used in C functions?

2014-05-12 Thread Kagamin via Digitalmars-d-learn
Why many? I'd say, you typically have 0 subscriptions (label, textbox) per widget, seldom - 1 (button, combobox, checkbox).

Re: Templating everything? One module per function/struct/class/etc, grouped by package?

2014-05-12 Thread Kagamin via Digitalmars-d-learn
You can write a tool, which will construct an amalgamation build of your code.

Re: How to make sure GC allocated resources stay around when used in C functions?

2014-05-12 Thread Gary Willoughby via Digitalmars-d-learn
On Monday, 12 May 2014 at 19:13:28 UTC, Kagamin wrote: AFAIK, addRoot is for memory allocated in GC heap, and addRange is for other types of memory, so you can't add non-gc memory as root (just a guess, see docs). I would allocate whole Args in GC heap and add is as root, yes, it would prevent

Re: How to make sure GC allocated resources stay around when used in C functions?

2014-05-12 Thread Kagamin via Digitalmars-d-learn
AFAIK, addRoot is for memory allocated in GC heap, and addRange is for other types of memory, so you can't add non-gc memory as root (just a guess, see docs). I would allocate whole Args in GC heap and add is as root, yes, it would prevent collection until the root is removed. A better way woul

Re: Templating everything? One module per function/struct/class/etc, grouped by package?

2014-05-12 Thread Francesco Cattoglio via Digitalmars-d-learn
On Monday, 12 May 2014 at 08:37:43 UTC, JR wrote: What am I missing? Error messages! If your code is not compiled, you can't know whether it is valid or not. I must say that since we have unittests, this is somewhat less relevant, but still... One nice thing would be stripping the executab

Re: Why std.algorithm.sort can't be applied to char[]?

2014-05-12 Thread Jonathan M Davis via Digitalmars-d-learn
On Mon, 12 May 2014 11:08:47 -0700 Charles Hixson via Digitalmars-d-learn wrote: > On 05/12/2014 09:29 AM, Jonathan M Davis via Digitalmars-d-learn > wrote: > > On Mon, 12 May 2014 14:49:52 + > > hane via Digitalmars-d-learn > > wrote: > > > >> and is there any way to sort char array with al

Re: Why std.algorithm.sort can't be applied to char[]?

2014-05-12 Thread Charles Hixson via Digitalmars-d-learn
On 05/12/2014 09:29 AM, Jonathan M Davis via Digitalmars-d-learn wrote: On Mon, 12 May 2014 14:49:52 + hane via Digitalmars-d-learn wrote: and is there any way to sort char array with algorithm.sort? --- import std.algorithm; import std.range; void main() { int[] arr = [5, 3, 7];

Re: core.sync.rwmutex example

2014-05-12 Thread Charles Hixson via Digitalmars-d-learn
On 05/10/2014 06:28 PM, TheFlyingFiddle via Digitalmars-d-learn wrote: On Friday, 9 May 2014 at 23:12:44 UTC, Charles Hixson via Digitalmars-d-learn wrote: But I'm worried about the receiving end. It needs, somehow, to ensure that the message it receives is the appropriate message, and that o

How to make sure GC allocated resources stay around when used in C functions?

2014-05-12 Thread Gary Willoughby via Digitalmars-d-learn
Based on this conversation in another thread: http://forum.dlang.org/thread/wdddgiowaidcojbrk...@forum.dlang.org?page=5#post-yjmrqgesjtadecutvkye:40forum.dlang.org I've realised i may have a nasty bug lurking in the code. Now i want to completely understand what is happening. Take the followin

Re: Why std.algorithm.sort can't be applied to char[]?

2014-05-12 Thread Jonathan M Davis via Digitalmars-d-learn
On Mon, 12 May 2014 14:49:52 + hane via Digitalmars-d-learn wrote: > and is there any way to sort char array with algorithm.sort? > --- > import std.algorithm; > import std.range; > > void main() > { >int[] arr = [5, 3, 7]; >sort(arr); // OK > >char[] arr2 = ['z', 'g', 'c']; >

Re: Templating everything? One module per function/struct/class/etc, grouped by package?

2014-05-12 Thread JR via Digitalmars-d-learn
On Monday, 12 May 2014 at 09:16:53 UTC, Jonathan M Davis via Digitalmars-d-learn wrote: Well, that would be a lot of extraneous files, which would be very messy IMHO. It also makes it much harder to share private functionality, because everything is scattered across modules - you'd be force to u

Re: Templating everything? One module per function/struct/class/etc, grouped by package?

2014-05-12 Thread Ary Borenszweig via Digitalmars-d-learn
On 5/12/14, 5:37 AM, JR wrote: Given that... 1. importing a module makes it compile the entirety of it, as well as whatever it may be importing in turn 2. templates are only compiled if instantiated 3. the new package.d functionality ...is there a reason *not* to make every single function/stru

Re: Configuring Phobos from the 1-click installer

2014-05-12 Thread Kapps via Digitalmars-d-learn
On Monday, 12 May 2014 at 15:02:54 UTC, Moses wrote: PATH environment variable is not related at all with phobos2 sources paths. All Linux packages (Ubuntu too) includes "-I/usr/include/dmd/phobos" on /etc/dmd.conf configuration file. If you need to explicit pass this argument to dmd compiler

Re: Configuring Phobos from the 1-click installer

2014-05-12 Thread Moses via Digitalmars-d-learn
PATH environment variable is not related at all with phobos2 sources paths. All Linux packages (Ubuntu too) includes "-I/usr/include/dmd/phobos" on /etc/dmd.conf configuration file. If you need to explicit pass this argument to dmd compiler, may be due to several reasons. - You've edited you

Re: Why std.algorithm.sort can't be applied to char[]?

2014-05-12 Thread John Colvin via Digitalmars-d-learn
On Monday, 12 May 2014 at 14:56:46 UTC, John Colvin wrote: On Monday, 12 May 2014 at 14:49:53 UTC, hane wrote: and is there any way to sort char array with algorithm.sort? --- import std.algorithm; import std.range; void main() { int[] arr = [5, 3, 7]; sort(arr); // OK char[] arr2 = ['z', '

Re: Why std.algorithm.sort can't be applied to char[]?

2014-05-12 Thread John Colvin via Digitalmars-d-learn
On Monday, 12 May 2014 at 14:49:53 UTC, hane wrote: and is there any way to sort char array with algorithm.sort? --- import std.algorithm; import std.range; void main() { int[] arr = [5, 3, 7]; sort(arr); // OK char[] arr2 = ['z', 'g', 'c']; sort(arr2); // error sort!q{ a[0] > b[0] }(

Why std.algorithm.sort can't be applied to char[]?

2014-05-12 Thread hane via Digitalmars-d-learn
and is there any way to sort char array with algorithm.sort? --- import std.algorithm; import std.range; void main() { int[] arr = [5, 3, 7]; sort(arr); // OK char[] arr2 = ['z', 'g', 'c']; sort(arr2); // error sort!q{ a[0] > b[0] }(zip(arr, arr2)); // error } --- I don't know what's d

Re: Templating everything? One module per function/struct/class/etc, grouped by package?

2014-05-12 Thread Jonathan M Davis via Digitalmars-d-learn
On Mon, 12 May 2014 08:37:42 + JR via Digitalmars-d-learn wrote: > Given that... > > 1. importing a module makes it compile the entirety of it, as > well as whatever it may be importing in turn > 2. templates are only compiled if instantiated > 3. the new package.d functionality > > ...is the

Templating everything? One module per function/struct/class/etc, grouped by package?

2014-05-12 Thread JR via Digitalmars-d-learn
Given that... 1. importing a module makes it compile the entirety of it, as well as whatever it may be importing in turn 2. templates are only compiled if instantiated 3. the new package.d functionality ...is there a reason *not* to make every single function/struct/class separate submodules

Re: Down the VisualD0.3.38-1.exe ,found virus!

2014-05-12 Thread FrankLike via Digitalmars-d-learn
ctc.exe is not distributed with the SDKs starting from VS2010, so mapping to a more recent version does not work. That's why there is a precompiled pkgcmd.cto file in the repository. You'll have to update its modification time to avoid the build process trying to generate it from pkgcmd.ctc e

Re: Down the VisualD0.3.38-1.exe ,found virus!

2014-05-12 Thread Rainer Schuetze via Digitalmars-d-learn
On 12.05.2014 08:36, FrankLike wrote: There are some quotes missing when building the Debug configuration. I have committed a fix and also added the missing file reported in your other message (IIRC it is not needed by every VS SDK). Sorry,Rainer Schuetze, Here is some error when compile the

Re: Down the VisualD0.3.38-1.exe ,found virus!

2014-05-12 Thread Rainer Schuetze via Digitalmars-d-learn
On 12.05.2014 08:38, FrankLike wrote: On Monday, 12 May 2014 at 06:36:10 UTC, FrankLike wrote: There are some quotes missing when building the Debug configuration. I have committed a fix and also added the missing file reported in your other message (IIRC it is not needed by every VS SDK).