Re: MySQL

2012-01-22 Thread Ali Çehreli
On 01/21/2012 06:28 PM, Mars wrote: On Sunday, 22 January 2012 at 00:50:28 UTC, Ali Çehreli wrote: Are you also including the library on the command line with -L-l? For example, for ncurses: dmd ... -L-lncurses ... And if needed, also -L-L to specify the location of library files for the

Re: MySQL

2012-01-22 Thread DNewbie
On Sun, Jan 22, 2012, at 12:11 AM, Ali Çehreli wrote: On 01/21/2012 06:28 PM, Mars wrote: On Sunday, 22 January 2012 at 00:50:28 UTC, Ali Çehreli wrote: Are you also including the library on the command line with -L-l? For example, for ncurses: dmd ... -L-lncurses ... And if

Re: MySQL

2012-01-22 Thread Mars
On Sunday, 22 January 2012 at 08:11:21 UTC, Ali Çehreli wrote: -L is dmd's the linker flag option. Anything after that is passed to the linker. So -L-l passes -l to the linker: http://www.d-programming-language.org/dmd-linux.html Ali Let me rephrase that, is this valid for OPTLINK?

Re: MySQL

2012-01-22 Thread Mars
On Sunday, 22 January 2012 at 10:21:29 UTC, DNewbie wrote: I've took a look at MySQL headers, the functions use stdcall, but in libmysql.dll exports table they are not decorated. This means...? Shouldn't it at least compile, if they are listed in the def file, coming from the lib?

for loop

2012-01-22 Thread RenatoL
This works: import�std.stdio; void�main() { int�x =�0; int�y =�0; for(;�((x��5)��(y��5));�x++,�y�++) { writeln(x + y = ,�x�+�y); } } The question is easy: is it possible to insert x and y internally in the for header? that is something like C# for (int x = 0, int y =

Re: for loop

2012-01-22 Thread Trass3r
for (int x = 0, int y = 0; .) for (int x=0, y=0; ...)

Re: for loop

2012-01-22 Thread RenatoL
Ops, tk u .. sometimes C# is a bad teacher :-)

Re: for loop

2012-01-22 Thread Max Klyga
On 2012-01-22 16:23:36 +0300, RenatoL said: This works: import std.stdio; void main() { int x = 0; int y = 0; for(; ((x  5)  (y  5)); x++, y ++) { writeln(x + y = , x + y); } } The question is easy: is it possible to insert x and y internally in the for header?

Re: for loop

2012-01-22 Thread bearophile
Max Klyga: If you want to declare and initialize several variables in the for loop, you can do it if they are of the same type: for (int x = 0, y = 0; ...; .++x, ++y) { ... } And if you need different types this sometimes is enough: void main() { for (auto x = 0, y = 0.0; x 10; x++,

Re: for loop

2012-01-22 Thread Zachary Lund
On 01/22/2012 11:08 AM, bearophile wrote: Max Klyga: If you want to declare and initialize several variables in the for loop, you can do it if they are of the same type: for (int x = 0, y = 0; ...; .++x, ++y) { ... } And if you need different types this sometimes is enough: void main() {

Re: for loop

2012-01-22 Thread Zachary Lund
On 01/22/2012 11:37 AM, Zachary Lund wrote: On 01/22/2012 11:08 AM, bearophile wrote: Max Klyga: If you want to declare and initialize several variables in the for loop, you can do it if they are of the same type: for (int x = 0, y = 0; ...; .++x, ++y) { ... } And if you need different

Re: MySQL

2012-01-22 Thread Jesse Phillips
On Sunday, 22 January 2012 at 12:11:58 UTC, Mars wrote: Let me rephrase that, is this valid for OPTLINK? Unknown Option : LLIBMYSQL Normally I just include the lib files in the files list (dmd foo.d bar.lib). Mars No, in fact I couldn't find how to pass a library search path to optlink.

Re: Reading web pages

2012-01-22 Thread Bystroushaak
Fixed. Bug was caused by HTTP 1.0 'HTTP 1.0 200 OK' reply. On 21.1.2012 13:14, Xan xan wrote: With png works, with pdf not: ./spider2 http://www.google.com/intl/ca/images/logos/mail_logo.png [a lot of output] $ ./spider2 http://static.arxiv.org/pdf/1109.4897.pdf [Longitud: [Excepció:

Re: MySQL

2012-01-22 Thread DNewbie
On Sun, Jan 22, 2012, at 01:13 PM, Mars wrote: On Sunday, 22 January 2012 at 10:21:29 UTC, DNewbie wrote: I've took a look at MySQL headers, the functions use stdcall, but in libmysql.dll exports table they are not decorated. This means...? Shouldn't it at least compile, if they are

eof of socketstream?

2012-01-22 Thread useo6
Hey guys, is there any way to find the end a socketstream? When I use: MemoryStream ms = new MemoryStream(); while (s.socket().isAlive()) ms.write(s.getc()); I run into an endless loop. The socket doesn't send the size of the data, so I need to know when I received all the data. How can I

Re: MySQL

2012-01-22 Thread Kapps
The way I did it is 1) Download C connector from mysql's website, 6.0.2 is version headers were made for. Remember you'll need the 32-bit one if you're using DMD on Windows. 2) Create the binding functions using extern(System). 3) For Windows, use 'coffimplib libmysql.dll libmysql.lib', and

no-argument constructor: is this a bug?

2012-01-22 Thread Caligo
struct A(uint samples){ float[samples] _data = void; this(float val = 0.0f){ fill(_data[], val); } } auto a = A!8(); a._data is filled with garbage instead of zeros because the no-argument constructor is called instead of the one that I've defined.

Re: no-argument constructor: is this a bug?

2012-01-22 Thread Timon Gehr
On 01/23/2012 12:51 AM, Caligo wrote: struct A(uint samples){ float[samples] _data = void; this(float val = 0.0f){ fill(_data[], val); } } auto a = A!8(); a._data is filled with garbage instead of zeros because the no-argument constructor is called instead of the one that I've

Re: no-argument constructor: is this a bug?

2012-01-22 Thread Jonathan M Davis
On Sunday, January 22, 2012 17:51:36 Caligo wrote: struct A(uint samples){ float[samples] _data = void; this(float val = 0.0f){ fill(_data[], val); } } auto a = A!8(); a._data is filled with garbage instead of zeros because the no-argument constructor is called instead of

Re: MySQL

2012-01-22 Thread DNewbie
On Sun, Jan 22, 2012, at 11:02 PM, DNewbie wrote: On Sun, Jan 22, 2012, at 01:13 PM, Mars wrote: On Sunday, 22 January 2012 at 10:21:29 UTC, DNewbie wrote: I've took a look at MySQL headers, the functions use stdcall, but in libmysql.dll exports table they are not decorated.

Re: MySQL

2012-01-22 Thread Mars
On Sunday, 22 January 2012 at 23:23:23 UTC, Kapps wrote: 2) Create the binding functions using extern(System). Oh man... that was the problem. The file I used was using extern(C). Thought that was okay, it's a C lib after all. Thank you! Mars