Installing x32 packages on x64 debian (or fix a dmd bug)

2012-03-27 Thread simendsjo
This might not be the best forum to ask, but as it relates a dmd bug, I hope others here have found a workaround. I'm using a debian-based x64 distro. Due to http://d.puremagic.com/issues/show_bug.cgi?id=5570, I have to compile for -m32. The challenge is installing 32-bit libraries using

Printing stacktrace on segfault

2012-03-27 Thread simendsjo
Is there a way to print a stacktrace on segfaults on linux?

Re: Installing x32 packages on x64 debian (or fix a dmd bug)

2012-03-27 Thread Jordi Sayol
Al 27/03/12 11:52, En/na simendsjo ha escrit: This might not be the best forum to ask, but as it relates a dmd bug, I hope others here have found a workaround. I'm using a debian-based x64 distro. Due to http://d.puremagic.com/issues/show_bug.cgi?id=5570, I have to compile for -m32. The

Re: Installing x32 packages on x64 debian (or fix a dmd bug)

2012-03-27 Thread simendsjo
On Tue, 27 Mar 2012 12:18:45 +0200, Jordi Sayol g.sa...@yahoo.es wrote: Al 27/03/12 11:52, En/na simendsjo ha escrit: This might not be the best forum to ask, but as it relates a dmd bug, I hope others here have found a workaround. I'm using a debian-based x64 distro. Due to

Re: Installing x32 packages on x64 debian (or fix a dmd bug)

2012-03-27 Thread Jordi Sayol
Al 27/03/12 12:40, En/na simendsjo ha escrit: On Tue, 27 Mar 2012 12:18:45 +0200, Jordi Sayol g.sa...@yahoo.es wrote: Al 27/03/12 11:52, En/na simendsjo ha escrit: This might not be the best forum to ask, but as it relates a dmd bug, I hope others here have found a workaround. I'm using a

Re: Rewrite of std.range docs (Was: Re: Making sense of ranges)

2012-03-27 Thread Marco Leise
Am Tue, 27 Mar 2012 06:00:58 +0200 schrieb Jesse Phillips jessekphillip...@gmail.com: On Monday, 26 March 2012 at 00:50:32 UTC, H. S. Teoh wrote: This thread has further convinced me that std.range's docs *need* this rewrite. So here's my first attempt at it:

std.stream.File help required (and classes)

2012-03-27 Thread akaz
Hi all, I am trying to port some application based on a library called mediastreamer2, part of linphone software. The basic software component built on top of mediastreamer2 is called a filter. Basically, it is a C structure with parameters and some methods (pointers to functions).

Re: std.stream.File help required (and classes)

2012-03-27 Thread akaz
I should at that the __gshared attribute was added in distress, but changed nothing. With or without it, the program still crashes.

Re: Rewrite of std.range docs (Was: Re: Making sense of ranges)

2012-03-27 Thread Mike Parker
On 3/27/2012 7:26 PM, Marco Leise wrote: Am Tue, 27 Mar 2012 06:00:58 +0200 schrieb Jesse Phillipsjessekphillip...@gmail.com: On Monday, 26 March 2012 at 00:50:32 UTC, H. S. Teoh wrote: This thread has further convinced me that std.range's docs *need* this rewrite. So here's my first attempt

Re: Installing x32 packages on x64 debian (or fix a dmd bug)

2012-03-27 Thread simendsjo
On Tue, 27 Mar 2012 13:24:06 +0200, Jordi Sayol g.sa...@yahoo.es wrote: Al 27/03/12 12:40, En/na simendsjo ha escrit: On Tue, 27 Mar 2012 12:18:45 +0200, Jordi Sayol g.sa...@yahoo.es wrote: Al 27/03/12 11:52, En/na simendsjo ha escrit: This might not be the best forum to ask, but as it

Re: GUI library

2012-03-27 Thread Tyro[17]
On Sunday, 25 March 2012 at 15:59:21 UTC, Jacob Carlborg wrote: On 2012-03-25 17:22, Kevin Cox wrote: I would reccomend Qt as well. You will get native cross-platform widgets with great performance. I am not sure how far QtD is but I know it once had a lot of development on it. I don't

Re: Printing stacktrace on segfault

2012-03-27 Thread David
Am 27.03.2012 12:04, schrieb simendsjo: Is there a way to print a stacktrace on segfaults on linux? I haven't found one, but you can use gdb, the only thing you've to do is to compile with -g and -gc (or you use gdc)

Problem about lambda expressions

2012-03-27 Thread Tongzhou Li
Hello again! I'm learning D, and I encountered a problem. I tried this code: http://ideone.com/hkpT6 It works well. (Have no idea why codepad.org failed to compile it) I tried to write a lambda instead of function f, but I got nothing printed. Did I make something wrong? Compiler used: DMD32 D

Re: Installing x32 packages on x64 debian (or fix a dmd bug)

2012-03-27 Thread simendsjo
On Tue, 27 Mar 2012 15:11:38 +0200, Jordi Sayol g.sa...@yahoo.es wrote: Al 27/03/12 15:03, En/na simendsjo ha escrit: I have ia32-libs, but say I want to install mysql? I can only get x64 versions thourgh the package manager. Trying to download and install 32-bit .deps says it's

Re: Problem about lambda expressions

2012-03-27 Thread Tongzhou Li
Oh, I also tried: void seq_apply(Params..., Args...)(void delegate(Params) func, Args args) But I got a error: variadic template parameter must be last Does it mean that there can only be one variadic template parameter? How to fix it? Thanks

Re: Problem with receiveOnly and classes

2012-03-27 Thread kraybourne
On 3/25/12 19:33 , Ghislain wrote: Hello, [...] I do not understand why an object of type A is fetched as a Variant, while a object of type B is received correctly. [...] Any idea? Hi! I get the same on Mac DMD 2.058. I have no idea. Looks like a bug to me, although I can't say which part

Re: Problem about lambda expressions

2012-03-27 Thread dennis luehring
Am 27.03.2012 15:52, schrieb Tongzhou Li: Oh, I also tried: void seq_apply(Params..., Args...)(void delegate(Params) func, Args args) But I got a error: variadic template parameter must be last Does it mean that there can only be one variadic template parameter? How to fix it? Thanks

Re: Rewrite of std.range docs (Was: Re: Making sense of ranges)

2012-03-27 Thread H. S. Teoh
On Tue, Mar 27, 2012 at 09:55:43PM +0900, Mike Parker wrote: On 3/27/2012 7:26 PM, Marco Leise wrote: [...] Ranges whose elements are sorted affords ...- insert a comma before affords perhaps? It would help non-native speakers. Actually, a comma there would be incorrect. But because

Re: std.stream.File help required (and classes)

2012-03-27 Thread H. S. Teoh
On Tue, Mar 27, 2012 at 01:58:03PM +0200, akaz wrote: [...] Now, the questions: 1. why there is std.stdio.File, but also std.stream.File? This gives a conflict and explicit names must then be used to avoid conflict. [...] This is a design flaw that will be fixed eventually. There's a

Re: Problem about lambda expressions

2012-03-27 Thread Artur Skawina
On 03/27/12 15:52, Tongzhou Li wrote: Oh, I also tried: void seq_apply(Params..., Args...)(void delegate(Params) func, Args args) But I got a error: variadic template parameter must be last Does it mean that there can only be one variadic template parameter? How to fix it? I'm not

Re: std.stream.File help required (and classes)

2012-03-27 Thread Steven Schveighoffer
On Tue, 27 Mar 2012 10:46:08 -0400, H. S. Teoh hst...@quickfur.ath.cx wrote: On Tue, Mar 27, 2012 at 01:58:03PM +0200, akaz wrote: [...] Now, the questions: 1. why there is std.stdio.File, but also std.stream.File? This gives a conflict and explicit names must then be used to avoid

Re: Problem about lambda expressions

2012-03-27 Thread Kenji Hara
On Tuesday, 27 March 2012 at 13:42:30 UTC, Tongzhou Li wrote: Hello again! I'm learning D, and I encountered a problem. I tried this code: http://ideone.com/hkpT6 It works well. (Have no idea why codepad.org failed to compile it) I tried to write a lambda instead of function f, but I got

Re: std.stream.File help required (and classes)

2012-03-27 Thread akaz
Thank you. But why do I lose access to my std.stream.File file? Somehow, the variable gets unallocated, thus the file is closed back? With pointers of C it used to be so simple... variable remained allocated untel the corresponding free(). I do not quite grasp this (a bit) awkward mix

Re: Printing stacktrace on segfault

2012-03-27 Thread Jonathan M Davis
On Tuesday, March 27, 2012 12:04:59 simendsjo wrote: Is there a way to print a stacktrace on segfaults on linux? You can do it if you install a signal handler for sigsegv and use backtrace_symbols to construct a stacktrace. Or you can just run the program in gdb or turn core dumps on and use

Re: Problem about lambda expressions

2012-03-27 Thread Ali Çehreli
On 03/27/2012 06:42 AM, Tongzhou Li wrote: Hello again! I'm learning D, and I encountered a problem. I tried this code: http://ideone.com/hkpT6 It works well. (Have no idea why codepad.org failed to compile it) I tried to write a lambda instead of function f, but I got nothing printed.

Re: Printing stacktrace on segfault

2012-03-27 Thread Jérôme M. Berger
simendsjo wrote: Is there a way to print a stacktrace on segfaults on linux? catchsegv (part of glibc, so should be available on just about all Linux distros...) Jerome -- mailto:jeber...@free.fr http://jeberger.free.fr Jabber: jeber...@jabber.fr signature.asc

D Dll injection problem

2012-03-27 Thread Gyron
Hey there, I want to inject a dll which was created in D into a c Program. Informations: DMD vs. 2.058 IDE: MonoDevelop with Mono-D System: Windows 7 64bit Program Informations: 32-bit written in c The Injector is working for sure, so thats not the Problem. the Source of the DLL: import

Re: std.stream.File help required (and classes)

2012-03-27 Thread Ali Çehreli
On 03/27/2012 04:58 AM, akaz wrote: 2. is the std.stream.File the correct choice here? Should I use std.file instead? Then, why so many file classes (count std.stdio.File too). std.file is more about files and directories, not file contents. I've abandoned std.stream.File some time ago. I

Re: D Dll injection problem

2012-03-27 Thread maarten van damme
when I tried the previous dmd compiler (have yet to try the curent one on this problem) I got the same problems while trying to compile a dll and use it. I have no clue as to why this is happening. worked in 2.54 I thought

Re: D Dll injection problem

2012-03-27 Thread Gyron
On Tuesday, 27 March 2012 at 20:45:52 UTC, maarten van damme wrote: when I tried the previous dmd compiler (have yet to try the curent one on this problem) I got the same problems while trying to compile a dll and use it. I have no clue as to why this is happening. worked in 2.54 I thought I

Re: D Dll injection problem

2012-03-27 Thread Trass3r
Maybe it's because I have no def file. Very possible. Just pass it to dmd like the other files. Or try the new -shared flag.

Re: std.stream.File help required (and classes)

2012-03-27 Thread akaz
std.file is more about files and directories, not file contents. I've abandoned std.stream.File some time ago. I just use std.stdio.File partly because stdio, stdout, and stderr are of that type anyway. It works with ranges as well. should be re-named std.folder, then, or std.filesystem.

Re: D Dll injection problem

2012-03-27 Thread Gyron
On Tuesday, 27 March 2012 at 21:12:59 UTC, Trass3r wrote: Maybe it's because I have no def file. Very possible. Just pass it to dmd like the other files. Or try the new -shared flag. I have tried both now (shared and def file linking), but know it's crashing my App, lol. I inject it but

Re: D Dll injection problem

2012-03-27 Thread Trass3r
I inject it but it returns nothing and the App(where the dll is injected) is hanging( not responding). Could you try it maybe? I would like to know whether it's a Problem with D or with me. Are dlls without injection working?

Re: D Dll injection problem

2012-03-27 Thread Gyron
On Tuesday, 27 March 2012 at 21:46:23 UTC, Trass3r wrote: I inject it but it returns nothing and the App(where the dll is injected) is hanging( not responding). Could you try it maybe? I would like to know whether it's a Problem with D or with me. Are dlls without injection working? I

Re: std.stream.File help required (and classes)

2012-03-27 Thread Ali Çehreli
On 03/27/2012 02:20 PM, akaz wrote: what is the equivalent of std.stream.File.writeBlock(const void* buffer, size_t size)? I see there is a std.stdio.rawWrite(T)(in T[] buffer); But, my data is: a (byte*) pointer and a length. How do I write something like

Re: std.stream.File help required (and classes)

2012-03-27 Thread akaz
OK, I converted into using the std.stdio.File. Without success, the programs till crashes. However, in the meantime: A) why there is no parameter-less constructor for std.stdio.File? I would like to have into my init function: s.filedesc=new File() and, then, in my setter open method

Re: std.stream.File help required (and classes)

2012-03-27 Thread Ali Çehreli
On 03/27/2012 02:57 PM, akaz wrote: B) In my function: private int msf_open(MSFilter* f, void* arg){ //a setter printf(msf_binfile_open-start\n\n); MSF_State* s=cast(MSF_State*)f.data; ms_mutex_lock((f.lock)); s.filedesc = new File(*(cast(string*)arg),w+b);

How to remove element from an SList?

2012-03-27 Thread Chris Pons
Right now i'm struggling with trying to understand how to remove an element from a n SList. I only want to remove one element, not a range of elements. I also don't want to use an Array because I will have to reshuffle elements to take care of the empty spot when I remove it. The only thing

Re: How to remove element from an SList?

2012-03-27 Thread James Miller
On 28 March 2012 13:02, Chris Pons cmp...@gmail.com wrote: Right now i'm struggling with trying to understand how to remove an element from a n SList. I only want to remove one element, not a range of elements. I also don't want to use an Array because I will have to reshuffle elements to take

Re: How to remove element from an SList?

2012-03-27 Thread Ali Çehreli
On 03/27/2012 05:02 PM, Chris Pons wrote: Right now i'm struggling with trying to understand how to remove an element from a n SList. I only want to remove one element, not a range of elements. I don't have experience with std.container but I think you need to call take(a, 1). The only

Re: How to remove element from an SList?

2012-03-27 Thread bearophile
Ali Çehreli: The following worked for me. Note treating the SList as a range by []: import std.container; import std.stdio; import std.algorithm; import std.range; void main() { auto l = SList!int(1, 2, 3, 4, 5, 6, 7); auto a = find(l[], 2); // Search for 2 ...