Re: Destructor order

2014-10-22 Thread Regan Heath via Digitalmars-d-learn
On Wed, 22 Oct 2014 16:49:20 +0100, eles e...@eles.com wrote: On Wednesday, 22 October 2014 at 15:45:02 UTC, eles wrote: D version with structs: { //display ~C~B~A A foo; B bar; C *caz = new C(); delete caz; } as expected.

Re: File needs to be closed on Windows but not on Posix, bug?

2014-07-07 Thread Regan Heath via Digitalmars-d-learn
On Mon, 07 Jul 2014 12:17:34 +0100, Joakim dl...@joakim.airpost.net wrote: On Monday, 7 July 2014 at 10:19:01 UTC, Kagamin wrote: See if stdio allows you to specify delete sharing when opening the file. I don't know what delete sharing is exactly, but the File constructor simply calls

Re: File needs to be closed on Windows but not on Posix, bug?

2014-07-07 Thread Regan Heath via Digitalmars-d-learn
On Mon, 07 Jul 2014 15:18:51 +0100, Jesse Phillips jesse.k.phillip...@gmail.com wrote: On Monday, 7 July 2014 at 12:00:48 UTC, Regan Heath wrote: But! I agree with Adam, leave it as a thin wrapper. Being a windows programmer by trade I would expect the remove to fail, I would not expect

Re: The writeln() function's args can't be [一 ,二]?

2014-05-06 Thread Regan Heath via Digitalmars-d-learn
On Tue, 06 May 2014 15:48:44 +0100, Marc Schütz schue...@gmx.net wrote: On Tuesday, 6 May 2014 at 13:35:57 UTC, FrankLike wrote: The problem is that you have a wide-character comma (,) there. This works: void main() { writeln([一, 二]); } No,I mean the execute result is

Re: A lot of people want to use D,but they only know MS SQL Server,what will help them to Learn D?

2014-05-01 Thread Regan Heath via Digitalmars-d-learn
On Thu, 01 May 2014 09:56:49 +0100, FrankLike 1150015...@qq.com wrote: On Monday, 14 April 2014 at 17:13:56 UTC, FrankLike wrote: My advice - use ODBC, it is the fastest way you may connect to the SQL server, and you already have everything you need for that. :) Regards I have test the

Re: std.file.read returns void[] why?

2014-04-17 Thread Regan Heath
On Wed, 16 Apr 2014 14:36:20 +0100, Spacen Jasset spacenjas...@mailrazer.com wrote: Why does the read function return void[] and not byte[] void[] read(in char[] name, size_t upTo = size_t.max); One one hand the data is always /actually/ going to be a load of (u)bytes, but /conceptually/

Re: std.file.read returns void[] why?

2014-04-17 Thread Regan Heath
On Thu, 17 Apr 2014 13:59:20 +0100, Steven Schveighoffer schvei...@yahoo.com wrote: It was never possible. You must explicitly cast to void[]. to - from? void[] makes actually little sense as the result of whole-file read that allocates. byte[] is at least usable and more accurate. In

Re: Iterate over an array while mutating it?

2014-03-28 Thread Regan Heath
On Thu, 27 Mar 2014 22:23:40 -, Anh Nhan anhn...@outlook.com wrote: Hey guys, I want to iterate over an array, while adding new entries, and have those in the iteration loop. See here: https://gist.github.com/AnhNhan/9820226 The problem is that the foreach loop seemingly only iterates

Re: GC for noobs

2014-02-28 Thread Regan Heath
On Thu, 27 Feb 2014 18:29:55 -, Szymon Gatner noem...@gmail.com wrote: On Thursday, 27 February 2014 at 18:06:58 UTC, John Colvin wrote: On Thursday, 27 February 2014 at 14:52:00 UTC, Szymon Gatner wrote: On Thursday, 27 February 2014 at 14:42:43 UTC, Dicebot wrote: There is also one

Re: Ranges, constantly frustrating

2014-02-17 Thread Regan Heath
This turned into a bit of a full spec so I would understand if you TL;DR but it would be nice to get some feedback if you have the time.. On Fri, 14 Feb 2014 17:34:46 -, bearophile bearophileh...@lycos.com wrote: Regan Heath: In my case I didn't need any of these. I don't understand

Re: Ranges, constantly frustrating

2014-02-14 Thread Regan Heath
On Fri, 14 Feb 2014 02:48:51 -, Jesse Phillips jesse.k.phillip...@gmail.com wrote: On Thursday, 13 February 2014 at 14:30:41 UTC, Regan Heath wrote: Don't get me wrong, counting the elements as you iterate over them is useful, but it isn't the index into the range you're likely after

Re: Ranges, constantly frustrating

2014-02-14 Thread Regan Heath
On Fri, 14 Feb 2014 13:14:51 -, bearophile bearophileh...@lycos.com wrote: Regan Heath: FWIW I disagree. I think it's immediately and intuitively obvious what 'i' should be when you're foreaching over X items taken from another range, even if you do not know take returns another

Re: Ranges, constantly frustrating

2014-02-14 Thread Regan Heath
On Fri, 14 Feb 2014 12:29:49 -, Jakob Ovrum jakobov...@gmail.com wrote: On Friday, 14 February 2014 at 12:10:51 UTC, Regan Heath wrote: FWIW I disagree. I think it's immediately and intuitively obvious what 'i' should be when you're foreaching over X items taken from another range

Re: Ranges, constantly frustrating

2014-02-13 Thread Regan Heath
On Wed, 12 Feb 2014 11:08:57 -, Jakob Ovrum jakobov...@gmail.com wrote: On Wednesday, 12 February 2014 at 10:44:57 UTC, Regan Heath wrote: Ahh.. so this is a limitation of the range interface. Any plans to fix this? R Did my original reply not arrive? It is the first reply

Re: Ranges, constantly frustrating

2014-02-13 Thread Regan Heath
On Wed, 12 Feb 2014 21:01:58 -, Jesse Phillips jesse.k.phillip...@gmail.com wrote: On Wednesday, 12 February 2014 at 10:52:13 UTC, Regan Heath wrote: On Tue, 11 Feb 2014 19:48:40 -, Jesse Phillips jesse.k.phillip...@gmail.com wrote: On Tuesday, 11 February 2014 at 10:10:27 UTC

Re: Ranges, constantly frustrating

2014-02-12 Thread Regan Heath
On Tue, 11 Feb 2014 17:11:46 -, Ali Çehreli acehr...@yahoo.com wrote: On 02/11/2014 06:25 AM, Rene Zwanenburg wrote: On Tuesday, 11 February 2014 at 10:10:27 UTC, Regan Heath wrote: foreach (i, line; range.take(4)) //Error: cannot infer argument types { ..etc.. } foreach

Re: Ranges, constantly frustrating

2014-02-12 Thread Regan Heath
On Tue, 11 Feb 2014 19:48:40 -, Jesse Phillips jesse.k.phillip...@gmail.com wrote: On Tuesday, 11 February 2014 at 10:10:27 UTC, Regan Heath wrote: Things like this should just work.. File input ... auto range = input.byLine(); while(!range.empty) { range.popFront(); foreach (i

Ranges, constantly frustrating

2014-02-11 Thread Regan Heath
Things like this should just work.. File input ... auto range = input.byLine(); while(!range.empty) { range.popFront(); foreach (i, line; range.take(4)) //Error: cannot infer argument types { ..etc.. } range.popFront(); } Tried adding 'int' and 'char[]' or 'auto' .. no dice.

Re: Ranges, constantly frustrating

2014-02-11 Thread Regan Heath
On Tue, 11 Feb 2014 10:52:39 -, Tobias Pankrath tob...@pankrath.net wrote: Further, the naive solution of adding .array gets you in all sorts of trouble :p (The whole byLine buffer re-use issue). This should be simple and easy, dare I say it trivial.. or am I just being dense here.

Re: Ranges, constantly frustrating

2014-02-11 Thread Regan Heath
On Tue, 11 Feb 2014 10:58:17 -, Tobias Pankrath tob...@pankrath.net wrote: On Tuesday, 11 February 2014 at 10:10:27 UTC, Regan Heath wrote: Things like this should just work.. File input ... auto range = input.byLine(); while(!range.empty) { range.popFront(); foreach (i, line

Re: ODBC SQLBindParameter for string array

2014-01-27 Thread Regan Heath
On Sat, 25 Jan 2014 11:05:11 -, Andre an...@s-e-a-p.de wrote: // CREATE TABLE demo(name VARCHAR(1)) // INSERT INTO demo (name) VALUES (?) string[] stringArr = [A,B,C]; SQLSetStmtAttr(hStmt, SQL_ATTR_PARAMSET_SIZE, cast(SQLPOINTER) stringArr.length, 0); SQLSetStmtAttr(hStmt,

Re: Slices, appending to arbitrary position

2013-12-31 Thread Regan Heath
On Mon, 30 Dec 2013 18:40:24 -, Dfr defle...@yandex.ru wrote: Thank you for replies, i think here i can use assoc array, but sometimes it is not suitable because it is not preserve order. What order do you want it in? The index order? If so, iterating over aa.keys.sort() will give

Re: how to detect OS architecture?

2013-12-20 Thread Regan Heath
On Thu, 19 Dec 2013 09:41:26 -, Marco Leise marco.le...@gmx.de wrote: Am Wed, 18 Dec 2013 13:19:09 - schrieb Regan Heath re...@netmail.co.nz: On Tue, 17 Dec 2013 15:13:20 -, Marco Leise marco.le...@gmx.de wrote: Am Tue, 17 Dec 2013 13:30:25 - schrieb Regan Heath re

Re: how to detect OS architecture?

2013-12-20 Thread Regan Heath
On Wed, 18 Dec 2013 13:43:44 -, Hugo Florentino h...@acdam.cu wrote: On Wed, 18 Dec 2013 13:20:45 -, Regan Heath wrote: On Wed, 18 Dec 2013 04:22:23 -, Hugo Florentino h...@acdam.cu wrote: On Tue, 17 Dec 2013 15:13:18 +0100, Gary Willoughby wrote: Make sure you handle

Re: how to detect OS architecture?

2013-12-18 Thread Regan Heath
On Wed, 18 Dec 2013 04:28:57 -, Hugo Florentino h...@acdam.cu wrote: On Tue, 17 Dec 2013 13:21:30 -, Regan Heath wrote: Is GetNativeSystemInfo your other solution? On the MSDN page for GetNativeSystemInfo it recommends using IsWow64Process to detect if you're running under WOW64

Re: how to detect OS architecture?

2013-12-18 Thread Regan Heath
On Tue, 17 Dec 2013 15:13:20 -, Marco Leise marco.le...@gmx.de wrote: Am Tue, 17 Dec 2013 13:30:25 - schrieb Regan Heath re...@netmail.co.nz: On Mon, 16 Dec 2013 21:27:13 -, Hugo Florentino h...@acdam.cu wrote: On Mon, 16 Dec 2013 20:23:00 +0100, Jacob Carlborg wrote: On 2013

Re: how to detect OS architecture?

2013-12-18 Thread Regan Heath
On Wed, 18 Dec 2013 04:22:23 -, Hugo Florentino h...@acdam.cu wrote: On Tue, 17 Dec 2013 15:13:18 +0100, Gary Willoughby wrote: Make sure you handle if users have a 32bit OS installed on a 64bit PC. As a matter of fact that was the actual configuration in the system I wrote the app. I

Re: how to detect OS architecture?

2013-12-17 Thread Regan Heath
On Mon, 16 Dec 2013 21:26:31 -, Hugo Florentino h...@acdam.cu wrote: On Mon, 16 Dec 2013 17:04:18 -, Regan Heath wrote: ... Compile the launcher as 32bit, and use this global boolean isWow64: ... Thanks, it's nice to have another option. What do you guys think are the possible

Re: how to detect OS architecture?

2013-12-17 Thread Regan Heath
On Mon, 16 Dec 2013 21:27:13 -, Hugo Florentino h...@acdam.cu wrote: On Mon, 16 Dec 2013 20:23:00 +0100, Jacob Carlborg wrote: On 2013-12-16 17:46, Marco Leise wrote: Hehe, I guess the whole purpose of the launcher is to run in 32-bit and detect at runtime if the 64-bit main executable

Re: how to detect OS architecture?

2013-12-16 Thread Regan Heath
On Mon, 16 Dec 2013 10:53:45 -, Hugo Florentino h...@acdam.cu wrote: I am writing a launcher to make a Windows application portable, but since this application supports both x86 and x86_64, I would like to detect the architecture of the OS my launcher is being run on, in order to launch

Re: How to handle nested structs when converting C headers?

2013-12-12 Thread Regan Heath
On Thu, 12 Dec 2013 00:04:07 -, H. S. Teoh hst...@quickfur.ath.cx wrote: On Thu, Dec 12, 2013 at 12:54:58AM +0100, Gary Willoughby wrote: On Wednesday, 11 December 2013 at 23:38:13 UTC, Adam D. Ruppe wrote: On Wednesday, 11 December 2013 at 23:35:04 UTC, Gary Willoughby wrote: static

Re: Win Headers

2013-12-12 Thread Regan Heath
On Thu, 12 Dec 2013 08:18:51 -, Mike Parker aldac...@gmail.com wrote: On 12/12/2013 4:44 PM, frustrated2 wrote: thanks for your reply. its a shame that the language does not supply ready to use headers. i can live with missing libraries, but not with incomplete or non working bare minimal

Re: Win Headers

2013-12-12 Thread Regan Heath
On Thu, 12 Dec 2013 12:16:57 -, Mike Parker aldac...@gmail.com wrote: On 12/12/2013 8:08 PM, Regan Heath wrote: MinGW distros. Even with VC, you still have to download the Windows SDK separately. I don't believe this last statement is true. I am fairly certain that upon installing VC

Re: Small troubles with private

2013-11-06 Thread Regan Heath
On Tue, 05 Nov 2013 16:00:41 -, bearophile bearophileh...@lycos.com wrote: 1) I usually write more than one class or struct inside each D module, unlike in Java. But sometimes when I move that class or struct elsewhere (during refactoring, or in other situations) I get access errors to

Re: How to cleanup after Socket.bind on Linux?

2013-08-27 Thread Regan Heath
On Tue, 27 Aug 2013 04:30:10 +0100, Ali Çehreli acehr...@yahoo.com wrote: The following simple socket example is trying to cleanup after itself, except the bind() call. As I repeat in the QUESTION comment below, I have read the man page of bind and I know that I need to unlink a path. How

Re: Order matters on inheritance

2013-08-22 Thread Regan Heath
On Thu, 22 Aug 2013 02:43:42 +0100, JS js.m...@gmail.com wrote: I don't know what the expected behavior is but it seems odd/wrong: http://dpaste.dzfl.pl/a390f1f4 Note that there are two issues here(almost the same). First is that A.foo isn't called and second is that the order of

Re: Style question

2013-07-12 Thread Regan Heath
On Thu, 11 Jul 2013 19:22:10 +0100, Namespace rswhi...@googlemail.com wrote: I have a style question, because a friend of mine has a similar problem currently and I have no good advice for him. Let's assume we have this classes: class MyClass { public: enum A {

Re: Can someone give me a little program design advice please?

2013-06-17 Thread Regan Heath
On Sun, 16 Jun 2013 16:27:27 +0100, Gary Willoughby d...@kalekold.net wrote: I'm writing a little program in D to perform some database operations and have a small question about design. Part of my program watches a log file for changes and this involves code which is wrapped up in a

Re: [Doubt] Variadic arguments as reference (Possible?)

2013-06-14 Thread Regan Heath
On Fri, 14 Jun 2013 13:55:29 +0100, MattCoder mattco...@gmail.com wrote: I want to know if there is a way to pass variadic arguments as reference? DMD says no! import std.stdio; import std.conv; void sum(double value, double*[] numbers ...){ foreach(ref num; numbers)

Re: std.traits functions causing the compiler to crash

2013-06-11 Thread Regan Heath
On Sat, 08 Jun 2013 05:52:49 +0100, Eric e...@makechip.com wrote: On Saturday, 8 June 2013 at 02:32:57 UTC, bearophile wrote: Eric: Yes, the template constraint is much better. However, the compiler still crashes, even with the new code: Because there's a type definition loop,

Re: and/or/not/xor operators

2013-06-05 Thread Regan Heath
On Tue, 04 Jun 2013 23:47:07 +0100, ixid nuacco...@gmail.com wrote: On Monday, 3 June 2013 at 09:29:20 UTC, Regan Heath wrote: On Fri, 31 May 2013 21:26:56 +0100, ixid nuacco...@gmail.com wrote: We really don't want D to become a TMTOWTDI language. Ideally there should be 1 right way

Re: and/or/not/xor operators

2013-06-03 Thread Regan Heath
On Fri, 31 May 2013 21:26:56 +0100, ixid nuacco...@gmail.com wrote: We really don't want D to become a TMTOWTDI language. Ideally there should be 1 right way and no alternatives. That way, anyone who knows D will have a greater chance of knowing what any given code sample does, and not

Re: and/or/not/xor operators

2013-05-31 Thread Regan Heath
On Fri, 31 May 2013 02:41:14 +0100, Shriramana Sharma samj...@gmail.com wrote: Thanks to all who replied. On Thu, May 30, 2013 at 10:18 PM, bearophile bearophileh...@lycos.com wrote: But Walter refused them time ago on the basis that no one uses them in C++. So you can ask for them in

Re: Writing closed source programs in D?

2013-05-31 Thread Regan Heath
On Fri, 31 May 2013 12:25:48 +0100, Shriramana Sharma samj...@gmail.com wrote: Now I'm *not* going to write closed source programs in D [;-)], but am curious -- in C++ we have header files which a developer can confidently distribute along with the compiled libraries, and the actual source of

Re: Producing library files from D

2013-05-31 Thread Regan Heath
On Fri, 31 May 2013 12:26:54 +0100, Shriramana Sharma samj...@gmail.com wrote: Hello. How do I make a library from D? I see the dmd --help output give a -lib option but am not sure how to actually use it. Can I produce a library and then just import it by its name? (This is an offshoot of my

Re: My first D program

2013-05-30 Thread Regan Heath
On Thu, 30 May 2013 12:13:19 +0100, Shriramana Sharma samj...@gmail.com wrote: Hello. I am new to D and come from some intermediate C/C++ plus some Python programming background. I currently have DMD 2.062 installed on my Kubuntu Raring 64-bit system. 1. Too big binary output? OK so I wrote

Re: WinAPI callbacks and GC

2013-05-07 Thread Regan Heath
On Tue, 07 May 2013 00:03:58 +0100, Sean Kelly s...@invisibleduck.org wrote: On May 2, 2013, at 6:17 AM, Regan Heath re...@netmail.co.nz wrote: On Wed, 01 May 2013 01:12:39 +0100, Sean Kelly s...@invisibleduck.org wrote: On Apr 23, 2013, at 2:21 PM, Jack Applegame jappleg...@gmail.com

Re: WinAPI callbacks and GC

2013-05-02 Thread Regan Heath
On Wed, 01 May 2013 01:12:39 +0100, Sean Kelly s...@invisibleduck.org wrote: On Apr 23, 2013, at 2:21 PM, Jack Applegame jappleg...@gmail.com wrote: According WinAPI documentation, CtrlHandler will be called in new additional thread. Is it safe to allocate GC memory in NOT Phobos

Re: WinAPI callbacks and GC

2013-04-24 Thread Regan Heath
On Tue, 23 Apr 2013 22:21:27 +0100, Jack Applegame jappleg...@gmail.com wrote: I'm writing Ctrl-C handler for console application for Windows: extern(Windows) { int CtrlHandler(uint flag) nothrow { auto tmp = new SomeClass; // is it safe? ... return true; } } ...

Re: Ref and class function calls?

2013-04-17 Thread Regan Heath
On Tue, 16 Apr 2013 18:51:06 +0100, Tofu Ninja emmo...@purdue.edu wrote: On Tuesday, 16 April 2013 at 15:23:56 UTC, Regan Heath wrote: I would question always question fully intended on a case by case basis: http://www.drdobbs.com/cpp/how-non-member-functions-improve-encapsu/184401197 I

Re: Ref and class function calls?

2013-04-17 Thread Regan Heath
On Wed, 17 Apr 2013 12:02:25 +0100, Regan Heath re...@netmail.co.nz wrote: So, ultimately encapsulation (one aspect of good design) should lead to code which is better in every measurable way, including running faster. It may not have been 100% clear what I was implying here. Because

Re: Ref and class function calls?

2013-04-17 Thread Regan Heath
On Wed, 17 Apr 2013 12:17:03 +0100, Tofu Ninja emmo...@purdue.edu wrote: On Wednesday, 17 April 2013 at 11:02:24 UTC, Regan Heath wrote: True, but this is what I'd call a short term view of encapsulation and code quality. Thinking about encapsulation in the short term is important because

Re: Ref and class function calls?

2013-04-16 Thread Regan Heath
On Tue, 16 Apr 2013 15:57:09 +0100, Tofu Ninja emmo...@purdue.edu wrote: On Tuesday, 16 April 2013 at 14:33:21 UTC, John Colvin wrote: A member function cannot modify it's own 'this' pointer. However, a free function can do it happily, which when combined with UFCS gives you the same syntax

Re: SocketStream and weird 0xA character

2013-03-20 Thread Regan Heath
On Sun, 17 Feb 2013 16:53:23 -, Lubos Pintes lubos.pin...@gmail.com wrote: I am writing little program which downloads simple data file from server through HTTP. The file is static, but updated regularly, so I am using Range: bytes header to optimize the traffic a bit. After I analyzed

Re: For DLLs, what does export actually do?

2013-02-11 Thread Regan Heath
On Sun, 10 Feb 2013 12:36:38 -, Ben Davis ent...@cantab.net wrote: On 10/02/2013 08:17, Benjamin Thaut wrote: Am 10.02.2013 03:03, schrieb Ben Davis: My functions are export extern (Windows) - I think they're global...? For example: export extern(Windows) LRESULT DriverProc(DWORD_PTR

Re: Idiomatic way to process const/immutable arrays as ranges

2013-02-11 Thread Regan Heath
On Mon, 11 Feb 2013 17:13:21 -, Dicebot m.stras...@gmail.com wrote: On Monday, 11 February 2013 at 16:54:04 UTC, Jonathan M Davis wrote: The const(T)[] cannot alter the original array at all, so I concur with Steven in that the complaints about not wanting to use tail-const make no

Re: Why is the 'protected' attribute considered useless?

2013-01-30 Thread Regan Heath
On Wed, 30 Jan 2013 09:20:54 -, simendsjo simend...@gmail.com wrote: On Wednesday, 30 January 2013 at 03:38:39 UTC, Chad Joan wrote: I've read more than once now that 'protected' is considered useless in D. Why is this? ... * private and protected in D works at module scope, not class

Re: how can D program find it's own executable name on windows ?

2013-01-29 Thread Regan Heath
On Tue, 29 Jan 2013 15:51:08 -, rsk82 rs...@live.com wrote: On Tuesday, 29 January 2013 at 15:46:40 UTC, monarch_dodra wrote: stdout.writeln(args[0]); It doesn't work while I have WinMain function that then calls myWinMain, as it is winsamp.d Error: undefined identifier args, did

Re: MS ODBC encoding issue

2013-01-23 Thread Regan Heath
On Wed, 23 Jan 2013 04:09:01 -, Sam Hu samhudotsa...@gmail.com wrote: for windows console show Chinese character issue,I've solved and posted on the forum before.Please refer to below link:

Re: MS ODBC encoding issue

2013-01-23 Thread Regan Heath
On Wed, 23 Jan 2013 04:41:11 -, Sam Hu samhudotsa...@gmail.com wrote: I've tested and the Chinese character issue really fixed! But I have two more issues here. 1.for connect with DSNless string function provided by my original code as below,I can not make it to connect successfully with

Re: MS ODBC encoding issue

2013-01-17 Thread Regan Heath
On Mon, 14 Jan 2013 10:02:04 -, Regan Heath re...@netmail.co.nz wrote: I'm more than happy to upload the database file here,but I can't find how to.May I have your mail address?Appreciated for all the help! My email address in the from is valid: regan at netmail dot co dot nz Ok

Re: MS ODBC encoding issue

2013-01-14 Thread Regan Heath
I'm more than happy to upload the database file here,but I can't find how to.May I have your mail address?Appreciated for all the help! My email address in the from is valid: regan at netmail dot co dot nz -- Using Opera's revolutionary email client: http://www.opera.com/mail/

Re: Unicode symbols in the identifiers

2013-01-11 Thread Regan Heath
On Fri, 11 Jan 2013 02:09:29 -, Andrey andr-...@yandex.ru wrote: Should these variants serve as identifiers? See: http://dlang.org/lex.html#Identifier Identifiers start with a letter, _, or universal alpha, and are followed by any number of letters, _, digits, or universal alphas.

Re: MS ODBC encoding issue

2012-12-31 Thread Regan Heath
On Mon, 24 Dec 2012 07:18:51 -, Sam Hu samhudotsa...@gmail.com wrote: On Friday, 21 December 2012 at 15:20:39 UTC, Regan Heath wrote: On Wed, 19 Dec 2012 06:33:16 -, Sam Hu samhudotsa...@gmail.com wrote: On Monday, 10 December 2012 at 14:43:08 UTC, Regan Heath wrote: Ahh

Re: calling fgets()

2012-12-31 Thread Regan Heath
On Mon, 24 Dec 2012 12:00:05 -, Red resm...@lavabit.com wrote: On Sunday, 23 December 2012 at 16:20:47 UTC, Mike Wey wrote: If you declare an char array you could pass it's pointer and length as the first two arguments. char[] buff = new char[1024]; fgets(buff.ptr, buff.length,

Re: MS ODBC encoding issue

2012-12-21 Thread Regan Heath
On Wed, 19 Dec 2012 06:33:16 -, Sam Hu samhudotsa...@gmail.com wrote: On Monday, 10 December 2012 at 14:43:08 UTC, Regan Heath wrote: Ahh, of course. Now I'm having linking issues :p I'm using VisualD and I've added odbc32.lib to the right place, but some symbols are still missing

Re: MS ODBC encoding issue

2012-12-10 Thread Regan Heath
On Fri, 07 Dec 2012 00:27:57 -, Sam Hu samhudotsa...@gmail.com wrote: On Thursday, 6 December 2012 at 16:44:01 UTC, Regan Heath wrote: On Thu, 06 Dec 2012 01:26:32 -, Sam Hu samhudotsa...@gmail.com wrote: Known issues: Under console reading Access table recordsets works fine

Re: MS ODBC encoding issue

2012-12-06 Thread Regan Heath
On Thu, 06 Dec 2012 01:26:32 -, Sam Hu samhudotsa...@gmail.com wrote: Known issues: Under console reading Access table recordsets works fine ,inserting a new record which contains only English characters works fine as well,but inserting new record which contains Chinese character will

Re: MS ODBC encoding issue

2012-12-05 Thread Regan Heath
On Wed, 05 Dec 2012 03:29:50 -, Sam Hu samhudotsa...@gmail.com wrote: On Tuesday, 4 December 2012 at 10:05:16 UTC, Nathan M. Swan wrote: I've never used ODBC before, but a quick scan of the MSDN docs suggests that you should use SQL_C_WCHAR instead, maybe using some D wstring

Re: VisualD solution configuration

2012-12-02 Thread Regan Heath
On Sun, 02 Dec 2012 15:08:51 -, Zhenya zh...@list.ru wrote: On Sunday, 2 December 2012 at 15:03:26 UTC, Zhenya wrote: On Sunday, 2 December 2012 at 14:58:24 UTC, Zhenya wrote: On Sunday, 2 December 2012 at 14:52:24 UTC, Lubos Pintes wrote: Not sure if I understand what you ask here, but

Re: template ref parameter

2012-11-21 Thread Regan Heath
On Wed, 21 Nov 2012 12:02:45 -, Jack Applegame jappleg...@gmail.com wrote: void foo(ref int a) { a--; } struct functor(A...) { void function(A) functor; } functor!int f;// functor!(ref int) - wrong f.functor = foo; // Error: cannot implicitly convert expression ( foo) of type void

Re: template ref parameter

2012-11-21 Thread Regan Heath
On Wed, 21 Nov 2012 12:30:08 -, Regan Heath re...@netmail.co.nz wrote: On Wed, 21 Nov 2012 12:02:45 -, Jack Applegame jappleg...@gmail.com wrote: void foo(ref int a) { a--; } struct functor(A...) { void function(A) functor; } functor!int f;// functor!(ref int) - wrong

Re: template ref parameter

2012-11-21 Thread Regan Heath
On Wed, 21 Nov 2012 12:32:24 -, Regan Heath re...@netmail.co.nz wrote: On Wed, 21 Nov 2012 12:30:08 -, Regan Heath re...@netmail.co.nz wrote: On Wed, 21 Nov 2012 12:02:45 -, Jack Applegame jappleg...@gmail.com wrote: void foo(ref int a) { a--; } struct functor

Re: About demangling

2012-11-01 Thread Regan Heath
On Thu, 01 Nov 2012 15:40:23 -, H. S. Teoh hst...@quickfur.ath.cx wrote: On Thu, Nov 01, 2012 at 03:16:25PM +0100, Dan wrote: On Thursday, 11 October 2012 at 21:04:28 UTC, Alex Rønne Petersen wrote: On 11-10-2012 22:56, Sean Kelly wrote: On Oct 11, 2012, at 6:17 AM, Lubos Pintes

Re: About demangling

2012-11-01 Thread Regan Heath
On Thu, 01 Nov 2012 15:40:23 -, H. S. Teoh hst...@quickfur.ath.cx wrote: On Thu, Nov 01, 2012 at 03:16:25PM +0100, Dan wrote: On Thursday, 11 October 2012 at 21:04:28 UTC, Alex Rønne Petersen wrote: On 11-10-2012 22:56, Sean Kelly wrote: On Oct 11, 2012, at 6:17 AM, Lubos Pintes

Re: About demangling

2012-11-01 Thread Regan Heath
On Thu, 01 Nov 2012 16:25:56 -, Regan Heath re...@netmail.co.nz wrote: Adding writefln to demangle.d to debug the issue shows that args[1] is - and that getopt is throwing the exception invalid UTF-8 sequence. I was wrong here, this line is the issue: stderr.writeln(e.msg); For some

Re: About demangling

2012-11-01 Thread Regan Heath
On Thu, 01 Nov 2012 17:21:29 -, H. S. Teoh hst...@quickfur.ath.cx wrote: On Thu, Nov 01, 2012 at 04:25:56PM -, Regan Heath wrote: On Thu, 01 Nov 2012 15:40:23 -, H. S. Teoh hst...@quickfur.ath.cx wrote: On Thu, Nov 01, 2012 at 03:16:25PM +0100, Dan wrote: On Thursday, 11 October

Re: getters and setters not an lvalue

2012-10-31 Thread Regan Heath
On Wed, 31 Oct 2012 14:08:18 -, maarten van damme maartenvd1...@gmail.com wrote: Ok, looking forward to the fix :) Btw, I have a foreach loop and in that foreach loop I want to decide if the current element can stay and if not, I want to remove it. If removing it yields an empty range in

Re: Correct way to map C #define to version

2012-10-29 Thread Regan Heath
On Mon, 29 Oct 2012 11:31:33 -, Sumit Raja sumitr...@gmail.com wrote: Thanks both this works great for structs. Anything similar I can do for enums? Example? (The C/C++ code you're trying to convert..) R -- Using Opera's revolutionary email client: http://www.opera.com/mail/

Re: Correct way to map C #define to version

2012-10-29 Thread Regan Heath
On Mon, 29 Oct 2012 13:47:46 -, Sumit Raja sumitr...@gmail.com wrote: On Monday, 29 October 2012 at 12:31:56 UTC, Regan Heath wrote: On Mon, 29 Oct 2012 11:31:33 -, Sumit Raja sumitr...@gmail.com wrote: Thanks both this works great for structs. Anything similar I can do for enums

Re: Sort order of dirEntries

2012-10-26 Thread Regan Heath
On Thu, 25 Oct 2012 01:15:06 +0100, Joseph Rushton Wakeling joseph.wakel...@webdrake.net wrote: Hello all, I've just been playing with dirEntries and by the looks of it, it returns these entries in arbitrary order. On windows, assuming it was using FindFirstFile or similar you would get

Re: How to start new command with arguments, pass data to its stdin read its output?

2012-10-23 Thread Regan Heath
On Tue, 23 Oct 2012 13:29:59 +0100, denizzzka 4deni...@gmail.com wrote: On Tuesday, 23 October 2012 at 12:19:08 UTC, Adam D. Ruppe wrote: On Tuesday, 23 October 2012 at 11:34:35 UTC, denizzzka wrote: Something like execv() but with stdin/stdout? If you're on linux i have a little file that

Re: Correct way to map C #define to version

2012-10-22 Thread Regan Heath
On Mon, 22 Oct 2012 12:39:48 +0100, bearophile bearophileh...@lycos.com wrote: Sumit Raja: Am I using version correctly? How is this done usually? I think version is usually meant to be given as compiler switch. Maybe a simple enum + static if is enough in your case. Good suggestion.

Re: optlink and weak symbols

2012-10-18 Thread Regan Heath
On Thu, 18 Oct 2012 07:41:16 +0100, Jacob Carlborg d...@me.com wrote: On 2012-10-18 05:12, Ellery Newcomer wrote: nice tip, but adding extern doesn't change link behavior at all. Hmm, are you linking with the DLL (the import library) ? In not, you need to use dlopen, or what the

Re: Stack trace output on windows

2012-10-17 Thread Regan Heath
On Tue, 16 Oct 2012 17:52:38 +0100, Benjamin Thaut c...@benjamin-thaut.de wrote: Am 16.10.2012 18:38, schrieb Regan Heath: I have some C/C++ code which handles windows SEH exceptions and can output (in debug mode) a stack trace, for example: But, it doesn't output symbol names

Re: abnormal program termination

2012-08-30 Thread Regan Heath
On Wed, 29 Aug 2012 18:43:27 +0100, Ellery Newcomer ellery-newco...@utulsa.edu wrote: On 08/28/2012 01:03 PM, Ellery Newcomer wrote: On 08/28/2012 09:55 AM, Regan Heath wrote: I searched the DMD sources, just in case the message abnormal program termination was DMD specific, and I found

Re: abnormal program termination

2012-08-29 Thread Regan Heath
On Tue, 28 Aug 2012 21:03:47 +0100, Ellery Newcomer ellery-newco...@utulsa.edu wrote: If you like, you could try building the unreduced case download pyd https://bitbucket.org/ariovistus/pyd from top dir, run (python setup.py install) go to examples/wrap, run (python setup.py build) Ok. I

Re: abnormal program termination

2012-08-29 Thread Regan Heath
On Wed, 29 Aug 2012 09:47:57 +0100, Regan Heath re...@netmail.co.nz wrote: On Tue, 28 Aug 2012 21:03:47 +0100, Ellery Newcomer ellery-newco...@utulsa.edu wrote: If you like, you could try building the unreduced case download pyd https://bitbucket.org/ariovistus/pyd from top dir, run

Re: abnormal program termination

2012-08-28 Thread Regan Heath
On Sat, 25 Aug 2012 01:10:05 +0100, Ellery Newcomer ellery-newco...@utulsa.edu wrote: I am running into an ICE on windows - Assertion Failure on such-and-such line in mtype.c - and I am trying to get a test command for to reduce it with the redoubtable dustmite. Normally, 'abnormal

Re: abnormal program termination

2012-08-28 Thread Regan Heath
On Tue, 28 Aug 2012 15:59:34 +0100, Ellery Newcomer ellery-newco...@utulsa.edu wrote: On 08/28/2012 06:37 AM, Regan Heath wrote: On Sat, 25 Aug 2012 01:10:05 +0100, Ellery Newcomer ellery-newco...@utulsa.edu wrote: I am running into an ICE on windows - Assertion Failure

Re: stdlib.exit()

2012-08-21 Thread Regan Heath
Not ideal, but it would work. - Regan Heath , since this is for a argument-parser, --help should print the help and then exit. Still, it can be done.. int main(string[] args) { int retval = 0; try { ParseArguments(args); } catch(ExitException e) { // Silent retval

Re: stdlib.exit()

2012-08-20 Thread Regan Heath
On Mon, 20 Aug 2012 10:03:56 +0100, David d...@dav1d.de wrote: Am 20.08.2012 09:15, schrieb Tracey: I use the following: import std.c.stdlib; exit(0); Yeah, but that doesn't terminate the runtime and will not call any dtors, right? std.c.stdlib.exit is the C runtime exit function which

Re: Cannot build ws2_32.lib

2012-08-03 Thread Regan Heath
On Fri, 03 Aug 2012 07:00:25 +0100, Andre Tampubolon an...@lc.vlsm.org wrote: On 8/3/2012 12:31 AM, Regan Heath wrote: Have you downloaded and extracted a normal dmd 2.0 installation/zip? If so, you should have: some path\dmd2\windows\lib\ws2_32.lib and your some path\dmd2\windows

Re: Cannot build ws2_32.lib

2012-08-02 Thread Regan Heath
On Thu, 02 Aug 2012 16:59:32 +0100, Andre Tampubolon an...@lc.vlsm.org wrote: I found this code from this page: http://rosettacode.org/wiki/Category:D import std.stdio, std.socket; void main(){ writefln(%s, Socket.hostName()); } When I tried to build it (I'm on Windows, anyway), I got

Re: Raw socket using data transfer

2012-08-01 Thread Regan Heath
On Wed, 01 Aug 2012 11:00:54 +0100, Gangadhar gangadhar@gmail.com wrote: By using raw s ocket programing data transfer from client to server please help me about this,any one have source code send me . The phobos source contains socket code you can inspect .. perhaps not RAW

Re: Detector for unused variables

2012-08-01 Thread Regan Heath
On Wed, 01 Aug 2012 11:38:46 +0100, bearophile bearophileh...@lycos.com wrote: Regan Heath: Indeed. IIRC Walter's rationale on things like this has always been that they belong in 3rd party tools. Walter is not always right. Well, in this case I agree with him. You're not looking

Re: Detector for unused variables

2012-08-01 Thread Regan Heath
On Wed, 01 Aug 2012 12:03:01 +0100, Andre Tampubolon an...@lc.vlsm.org wrote: The Go compiler is able to detect unused variables, and strangely they are regarded as an error. It's not really a question of able to, or not. I'm sure were Walter to decide to add this feature to D he would

Re: Detector for unused variables

2012-08-01 Thread Regan Heath
On Wed, 01 Aug 2012 15:52:22 +0100, bearophile bearophileh...@lycos.com wrote: Regan Heath: If you make detecting un-used variables a /requirement/ for implementing a D compiler, you make it that much less likely someone will write one, Detecting unused variables can be written as a part

Re: Writing very large files 50+ GB

2012-07-27 Thread Regan Heath
On Fri, 27 Jul 2012 02:50:56 +0100, wmunger wmun...@gmail.com wrote: I need to write to a file that is 50 to 250GB on all three major operating systems. I tried to use the c function pwrite64. But it is not available on the Mac. I have seen where some have used the iostream in C++ but

Re: More WinAPI problems

2012-07-20 Thread Regan Heath
On Fri, 20 Jul 2012 14:07:51 +0100, DLimited tanojo...@googlemail.com wrote: Hello everyone, I encountered a few more problems while creating my system-wide makro program. 1) I can't load my dll with LoadLibraryW, only LoadLibraryA. Why? How are you passing the DLL filename to

  1   2   >