Re: Messy code in console

2014-05-13 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:

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

2014-05-13 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 s

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

2014-05-13 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

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

2014-05-13 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: naming a variable at runtime

2014-05-13 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-13 Thread Kagamin via Digitalmars-d-learn
Do you always bind all of them?

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

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

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

2014-05-13 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

Template delegate/function ptr struct member

2014-05-13 Thread ed via Digitalmars-d-learn
I'm porting some C++ code to D and a struct has the following member: struct S { // ... //void* (*createMethod)(); void* function() createMethod; } I'd like to extend this as little to accept delegates for future use without breakage to existing code... Is it possible to template this so

Re: Template delegate/function ptr struct member

2014-05-13 Thread Rikki Cattermole via Digitalmars-d-learn
On 13/05/2014 7:28 p.m., ed wrote: I'm porting some C++ code to D and a struct has the following member: struct S { // ... //void* (*createMethod)(); void* function() createMethod; } I'd like to extend this as little to accept delegates for future use without breakage to existing code...

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

2014-05-13 Thread hane via Digitalmars-d-learn
On Monday, 12 May 2014 at 14:56:46 UTC, John Colvin wrote: char[] is a rather special type of array: the language has unicode support and iterates over it by code-point (i.e. not guaranteed to be a single char per iteration). If you want to sort chars and are assuming ASCII, you can just use

How to use the std.process?

2014-05-13 Thread FrankLike via Digitalmars-d-learn
I want to start the process by std.process. module main; import std.process,std.stdio; void main() { string url = http://dlang.org/;; executeShell(escapeShellCommand(wget, url, -O, dlang-index.html)); executeShell(iexplore localhost:8080); } But not open 'IE'. Why? Thank

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

2014-05-13 Thread Jacob Carlborg via Digitalmars-d-learn
On 13/05/14 08:44, FrankLike wrote: Thank you. DWT AND DFL ,their Memory Usage is the least . but DWT is more complicated than DFL. Look at the base control :Button at DFL :only 270 lines , but at DWT: need 1400 lines. Thank you again. The question is what the buttons in each library is

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

2014-05-13 Thread FrankLike via Digitalmars-d-learn
On Tuesday, 13 May 2014 at 09:32:43 UTC, Jacob Carlborg wrote: On 13/05/14 08:44, FrankLike wrote: Thank you. DWT AND DFL ,their Memory Usage is the least . but DWT is more complicated than DFL. Look at the base control :Button at DFL :only 270 lines , but at DWT: need 1400 lines. Thank you

Re: Messy code in console

2014-05-13 Thread IceNature via Digitalmars-d-learn
I see... I will search the document. Thank you. On 2014年5月13日 格林尼治标准时间+0800下午1时58分20秒, Ali Çehreli via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: 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

Re: How to use the std.process?

2014-05-13 Thread Mengu via Digitalmars-d-learn
On Tuesday, 13 May 2014 at 08:56:43 UTC, FrankLike wrote: I want to start the process by std.process. module main; import std.process,std.stdio; void main() { string url = http://dlang.org/;; executeShell(escapeShellCommand(wget, url, -O, dlang-index.html));

Re: How to use the std.process?

2014-05-13 Thread FrankLike via Digitalmars-d-learn
does it work when you run iexplore localhost:8000 in command line? is path to iexplore in your windows path? module main; import std.process,std.stdio; void main() { spawnProcess(C:\\Program Files (x86)\\Internet Explorer\\iexplore); } it can work.but the args is not easy to input.

Re: How to use the std.process?

2014-05-13 Thread FrankLike via Digitalmars-d-learn
does it work when you run iexplore localhost:8000 in command line? is path to iexplore in your windows path? Ok,I get the answer by myself. module main; import std.process,std.stdio; void main() { //spawnProcess(C:\\Program Files (x86)\\Internet Explorer\\iexplore);

Re: Template delegate/function ptr struct member

2014-05-13 Thread uri via Digitalmars-d-learn
On Tuesday, 13 May 2014 at 07:50:09 UTC, Rikki Cattermole wrote: On 13/05/2014 7:28 p.m., ed wrote: I'm porting some C++ code to D and a struct has the following member: struct S { // ... //void* (*createMethod)(); void* function() createMethod; } I'd like to extend this as little to

Re: How to use the std.process?

2014-05-13 Thread Mengu via Digitalmars-d-learn
On Tuesday, 13 May 2014 at 10:48:06 UTC, FrankLike wrote: does it work when you run iexplore localhost:8000 in command line? is path to iexplore in your windows path? Ok,I get the answer by myself. module main; import std.process,std.stdio; void main() { //spawnProcess(C:\\Program Files

Re: Recommendation on option parsing

2014-05-13 Thread Robert Schadek via Digitalmars-d-learn
On 05/13/2014 05:40 AM, Chris Piker via Digitalmars-d-learn wrote: On Monday, 12 May 2014 at 23:11:57 UTC, Robert Schadek via Digitalmars-d-learn wrote: Okay, I replaced the std.getopt that came with dmd with your version. My code compiles, but of course it doesn't link against the old

Re: Recommendation on option parsing

2014-05-13 Thread Vladimir Panteleev via Digitalmars-d-learn
On Tuesday, 13 May 2014 at 03:40:57 UTC, Chris Piker wrote: I like your enthusiasm. If you have any modules that don't require me to rebuild libphobos, I'll be happy to give them a whirl. Thank's for responding to my inquiry. Try Digger! https://github.com/CyberShadow/Digger Run: digger

Re: How to use the std.process?

2014-05-13 Thread FrankLike via Digitalmars-d-learn
that is actually what i meant by is path to iexplore in your windows path? :) Thank you,but it is another function,in other language ,it can work for IE.

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

2014-05-13 Thread thedeemon via Digitalmars-d-learn
On Tuesday, 13 May 2014 at 00:10:15 UTC, 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.

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

2014-05-13 Thread Suliman via Digitalmars-d-learn
DFL is really cool. Not all programmers need complex toolkits. A lot of need easy to learning toolkits for medium projects. It would be cool if somebody will handle developing of DFL. It's better to have one such toolkit, than tons of complex and not finished toolkits.

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

2014-05-13 Thread FrankLike via Digitalmars-d-learn
DFL is just a thin wrapper around Win32, no surprise. I've found my apps written using DFL work quite fine in Linux via Wine, so I use them from both OSes. In Linux?The exe was compiled in win32? Don't play jokes on it.

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

2014-05-13 Thread FrankLike via Digitalmars-d-learn
On Tuesday, 13 May 2014 at 15:28:05 UTC, Suliman wrote: DFL is really cool. Not all programmers need complex toolkits. A lot of need easy to learning toolkits for medium projects. It would be cool if somebody will handle developing of DFL. It's better to have one such toolkit, than tons of

Re: Recommendation on option parsing

2014-05-13 Thread Chris Piker via Digitalmars-d-learn
Okay, I replaced the std.getopt that came with dmd with your version. My code compiles, but of course it doesn't link against the old libphobos.so. Well, it is a pull request for std.getopt, therefore it can't stand alone. That been said, get into getopt.d and copy anything below line 1061 (

Re: Recommendation on option parsing

2014-05-13 Thread Chris Piker via Digitalmars-d-learn
On Tuesday, 13 May 2014 at 12:08:51 UTC, Vladimir Panteleev wrote: On Tuesday, 13 May 2014 at 03:40:57 UTC, Chris Piker wrote: I like your enthusiasm. If you have any modules that don't require me to rebuild libphobos, I'll be happy to give them a whirl. Thank's for responding to my inquiry.

Re: Any chance to avoid monitor field in my class?

2014-05-13 Thread Daniel Murphy via Digitalmars-d-learn
Yuriy wrote in message news:uflaemdlxvavfmvkb...@forum.dlang.org... Hello, is there a way of reducing size of an empty class to just vtbl? I tried to declare it as extern(C++) which works, but has a nasty side effect of limited mangling. What exactly is the mangling problem with extern(C++)

Re: Any chance to avoid monitor field in my class?

2014-05-13 Thread Yuriy via Digitalmars-d-learn
On Tuesday, 13 May 2014 at 17:09:01 UTC, Daniel Murphy wrote: What exactly is the mangling problem with extern(C++) classes? Can't use D arrays (and strings) as function argument types. Can't use D array types as template arguments. extern (C++) MyClass(T) { } MyClass!string a; // Mangling

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

2014-05-13 Thread Gary Willoughby via Digitalmars-d-learn
On Tuesday, 13 May 2014 at 06:27:14 UTC, Kagamin wrote: Do you always bind all of them? They are not bound automatically but may be bound later. You can bind to events such as mouse-enter, mouse-click, keypresses, etc. In fact this is how keyboard shortcuts are handled. I've added a

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

2014-05-13 Thread Jacob Carlborg via Digitalmars-d-learn
On 2014-05-13 12:14, FrankLike wrote: Look at the Button class in DWT. In Linux ,button class need 844 lines,but in win32 ,button class need 1300 lines. Look at the setText Method in button class. There is a great difference between in Linux and in Win32. public void setText (String

RegEx for a simple Lexer

2014-05-13 Thread Tim Holzschuh via Digitalmars-d-learn
Hi there, I read a book about an introduction to creating programming languages (really basic). The sample code is written in Ruby, but I want to rewrite the examples in D. However, the Lexer uses Ruby's regex features to scan the code. I'm not very familiar with D's RegEx system (nor with

Re: *** GMX Spamverdacht *** RegEx for a simple Lexer

2014-05-13 Thread Tim Holzschuh via Digitalmars-d-learn
Am 13.05.2014 21:53, schrieb Tim Holzschuh via Digitalmars-d-learn: In the book a parser generator like Yacc is used to create a suitable parser. Is there an equivalent for D? Or if not: is it really that hard to create a parser that is able to parse sth. like this: Ah, found pegged [1],

Re: RegEx for a simple Lexer

2014-05-13 Thread anonymous via Digitalmars-d-learn
On Tuesday, 13 May 2014 at 19:53:17 UTC, Tim Holzschuh via Digitalmars-d-learn wrote: If I also want to create a RegEx to filter string-expressions a la xyz , how would I do this? At least match( src, r^\ (.*) $\ ); doesn't seem to work and I couldn't find in the Library Reference how to

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

2014-05-13 Thread jack death via Digitalmars-d-learn
It would be cool if somebody will handle developing of DFL. It's better to have one such toolkit, than tons of complex and not finished toolkits. isn't that the truth. as much as i like D, i find it unusable for me, since i do not have a ui-/db-toolkit. i want to use the language, not invent

Re: RegEx for a simple Lexer

2014-05-13 Thread Brian Schott via Digitalmars-d-learn
On Tuesday, 13 May 2014 at 19:53:17 UTC, Tim Holzschuh via Digitalmars-d-learn wrote: Hi there, I read a book about an introduction to creating programming languages (really basic). The sample code is written in Ruby, but I want to rewrite the examples in D. However, the Lexer uses Ruby's

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

2014-05-13 Thread Gary Willoughby via Digitalmars-d-learn
On Tuesday, 13 May 2014 at 20:42:11 UTC, jack death wrote: It would be cool if somebody will handle developing of DFL. It's better to have one such toolkit, than tons of complex and not finished toolkits. Tkd is finished. Gtk-D is finished. You aren't going to get very far unless you

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

2014-05-13 Thread FrankLike via Digitalmars-d-learn
On Tuesday, 13 May 2014 at 19:02:03 UTC, Jacob Carlborg wrote: On 2014-05-13 12:14, FrankLike wrote: Look at the Button class in DWT. In Linux ,button class need 844 lines,but in win32 ,button class need 1300 lines. Look at the setText Method in button class. There is a great difference

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

2014-05-13 Thread ed via Digitalmars-d-learn
On Tuesday, 13 May 2014 at 15:20:36 UTC, FrankLike wrote: DFL is just a thin wrapper around Win32, no surprise. I've found my apps written using DFL work quite fine in Linux via Wine, so I use them from both OSes. In Linux?The exe was compiled in win32? Don't play jokes on it. He's not

Re: RegEx for a simple Lexer

2014-05-13 Thread Ary Borenszweig via Digitalmars-d-learn
On 5/13/14, 5:43 PM, anonymous wrote: On Tuesday, 13 May 2014 at 19:53:17 UTC, Tim Holzschuh via Digitalmars-d-learn wrote: If I also want to create a RegEx to filter string-expressions a la xyz , how would I do this? At least match( src, r^\ (.*) $\ ); doesn't seem to work and I couldn't

Re: Recommendation on option parsing

2014-05-13 Thread Jesse Phillips via Digitalmars-d-learn
On Tuesday, 13 May 2014 at 17:05:15 UTC, Chris Piker wrote: I tried that, but you're using private members of std.getopt (which of course is okay for the way you intended the code to be used) so I stopped pursuing this solution. Not sure why he had you break up the file. It should be as simple

Re: Recommendation on option parsing

2014-05-13 Thread Chris Piker via Digitalmars-d-learn
On Wednesday, 14 May 2014 at 04:15:04 UTC, Jesse Phillips wrote: Anyway, D's libraries are not as extensive as Python/Ruby/Perl. True, but they wouldn't need to have much more to pass the good-enough threshold for me. In my current position I mostly write relatively simple server side