Re: Destructor order

2014-10-22 Thread Regan Heath via Digitalmars-d-learn
On Wed, 22 Oct 2014 16:49:20 +0100, eles 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. Structs are speci

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 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 all my files to be opened

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 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 fopen and I don't see any o

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 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 error.That doesn't ge

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 Thu, 17 Apr 2014 13:59:20 +0100, Steven Schveighoffer 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 fact, it's a little d

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

2014-04-17 Thread Regan Heath
On Wed, 16 Apr 2014 14:36:20 +0100, Spacen Jasset 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/ it might be structs or som

Re: Iterate over an array while mutating it?

2014-03-28 Thread Regan Heath
On Thu, 27 Mar 2014 22:23:40 -, Anh Nhan 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 over the original

Re: GC for noobs

2014-02-28 Thread Regan Heath
On Thu, 27 Feb 2014 18:29:55 -, Szymon Gatner 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 complex and feature-

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 wrote: Regan Heath: In my case I didn't need any of these. I don't understand. What I mea

Re: Ranges, constantly frustrating

2014-02-14 Thread Regan Heath
On Fri, 14 Feb 2014 12:29:49 -, Jakob Ovrum 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-14 Thread Regan Heath
On Fri, 14 Feb 2014 13:14:51 -, bearophile 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 ran

Re: Ranges, constantly frustrating

2014-02-14 Thread Regan Heath
On Fri, 14 Feb 2014 02:48:51 -, Jesse Phillips 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. Nope, not

Re: Ranges, constantly frustrating

2014-02-13 Thread Regan Heath
On Wed, 12 Feb 2014 21:01:58 -, Jesse Phillips wrote: On Wednesday, 12 February 2014 at 10:52:13 UTC, Regan Heath wrote: On Tue, 11 Feb 2014 19:48:40 -, Jesse Phillips wrote: On Tuesday, 11 February 2014 at 10:10:27 UTC, Regan Heath wrote: Things like this should "just

Re: Ranges, constantly frustrating

2014-02-13 Thread Regan Heath
On Wed, 12 Feb 2014 11:08:57 -, Jakob Ovrum 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 in the thread..

Re: Ranges, constantly frustrating

2014-02-12 Thread Regan Heath
On Tue, 11 Feb 2014 19:48:40 -, Jesse Phillips 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; ra

Re: Ranges, constantly frustrating

2014-02-12 Thread Regan Heath
On Tue, 11 Feb 2014 19:08:18 -, Jesse Phillips wrote: On Tuesday, 11 February 2014 at 13:00:19 UTC, Regan Heath wrote: import std.stdio; struct S1 { private int[] elements = [9,8,7]; int opApply (int delegate (ref uint, ref int) block) { foreach (uint i, int n

Re: Ranges, constantly frustrating

2014-02-12 Thread Regan Heath
On Tue, 11 Feb 2014 19:16:31 -, Steven Schveighoffer wrote: On Tue, 11 Feb 2014 05:10:27 -0500, Regan Heath wrote: Things like this should "just work".. File input ... auto range = input.byLine(); while(!range.empty) { range.popFront(); foreach (i, line; ra

Re: Ranges, constantly frustrating

2014-02-12 Thread Regan Heath
On Tue, 11 Feb 2014 13:11:54 -, Tobias Pankrath wrote: On Tuesday, 11 February 2014 at 13:00:19 UTC, Regan Heath wrote: import std.stdio; struct S1 { private int[] elements = [9,8,7]; int opApply (int delegate (ref uint, ref int) block) { foreach (uint i, int n

Re: Ranges, constantly frustrating

2014-02-12 Thread Regan Heath
On Tue, 11 Feb 2014 17:11:46 -, Ali Çehreli 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 (i, line; iota

Re: Ranges, constantly frustrating

2014-02-11 Thread Regan Heath
On Tue, 11 Feb 2014 10:58:17 -, Tobias Pankrath 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; ra

Re: Ranges, constantly frustrating

2014-02-11 Thread Regan Heath
On Tue, 11 Feb 2014 10:52:39 -, Tobias Pankrath 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. R The second nai

Re: Ranges, constantly frustrating

2014-02-11 Thread Regan Heath
On Tue, 11 Feb 2014 10:10:27 -, Regan Heath wrote: 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 {

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. C

Re: ODBC SQLBindParameter for string array

2014-01-27 Thread Regan Heath
On Sat, 25 Jan 2014 11:05:11 -, Andre 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, SQL_ATTR_PARAM_BIND_TY

Re: Slices, appending to arbitrary position

2013-12-31 Thread Regan Heath
On Mon, 30 Dec 2013 18:40:24 -, Dfr 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 you the keys in tha

Re: how to detect OS architecture?

2013-12-20 Thread Regan Heath
On Wed, 18 Dec 2013 13:43:44 -, Hugo Florentino wrote: On Wed, 18 Dec 2013 13:20:45 -, Regan Heath wrote: On Wed, 18 Dec 2013 04:22:23 -, Hugo Florentino wrote: On Tue, 17 Dec 2013 15:13:18 +0100, Gary Willoughby wrote: Make sure you handle if users have a 32bit OS

Re: how to detect OS architecture?

2013-12-20 Thread Regan Heath
On Thu, 19 Dec 2013 09:41:26 -, Marco Leise wrote: Am Wed, 18 Dec 2013 13:19:09 - schrieb "Regan Heath" : On Tue, 17 Dec 2013 15:13:20 -, Marco Leise wrote: > Am Tue, 17 Dec 2013 13:30:25 -0000 > schrieb "Regan Heath" : > >> On Mon, 16 Dec 2

Re: how to detect OS architecture?

2013-12-18 Thread Regan Heath
On Wed, 18 Dec 2013 04:22:23 -, Hugo Florentino 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 am now with a

Re: how to detect OS architecture?

2013-12-18 Thread Regan Heath
On Wed, 18 Dec 2013 04:28:57 -, Hugo Florentino 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, at which

Re: how to detect OS architecture?

2013-12-18 Thread Regan Heath
On Tue, 17 Dec 2013 15:13:20 -, Marco Leise wrote: Am Tue, 17 Dec 2013 13:30:25 - schrieb "Regan Heath" : On Mon, 16 Dec 2013 21:27:13 -, Hugo Florentino wrote: > On Mon, 16 Dec 2013 20:23:00 +0100, Jacob Carlborg wrote: >> On 2013-12-16 17:46, Marco Leise

Re: how to detect OS architecture?

2013-12-17 Thread Regan Heath
On Mon, 16 Dec 2013 21:27:13 -, Hugo Florentino 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 can be run or t

Re: how to detect OS architecture?

2013-12-17 Thread Regan Heath
On Mon, 16 Dec 2013 21:26:31 -, Hugo Florentino 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 poss

Re: how to detect OS architecture?

2013-12-16 Thread Regan Heath
On Mon, 16 Dec 2013 10:53:45 -, Hugo Florentino 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 the proper ex

Re: Win Headers

2013-12-12 Thread Regan Heath
On Thu, 12 Dec 2013 12:16:57 -, Mike Parker 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 you have every

Re: Win Headers

2013-12-12 Thread Regan Heath
On Thu, 12 Dec 2013 08:18:51 -, Mike Parker 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 prerequisites to us

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 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 union internalRep >

Re: Small troubles with "private"

2013-11-06 Thread Regan Heath
On Tue, 05 Nov 2013 16:00:41 -, bearophile 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 private fields. Those

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 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 can I get that path?

Re: Order matters on inheritance

2013-08-22 Thread Regan Heath
On Thu, 22 Aug 2013 02:43:42 +0100, JS 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 inheritance on A matters(:

Re: Why is size_t unsigned?

2013-07-22 Thread Regan Heath
On Mon, 22 Jul 2013 04:47:34 +0100, JS wrote: Doing simple stuff like for(int i = 0; i < s.length - 1; i++) fails catastrophically if s is empty. To make right one has to reduce performance by writing extra checks. There seems to be no real good reason why size_t is unsigned... Surely

Re: Style question

2013-07-12 Thread Regan Heath
On Thu, 11 Jul 2013 19:22:10 +0100, Namespace 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 { Foo = 0,

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 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 class. So the usage i

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

2013-06-14 Thread Regan Heath
On Fri, 14 Jun 2013 13:55:29 +0100, MattCoder 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) *num = *num + value;

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 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, regardless. Using a constrai

Re: and/or/not/xor operators

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

Re: and/or/not/xor operators

2013-06-03 Thread Regan Heath
On Fri, 31 May 2013 21:26:56 +0100, ixid 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 have to look up alter

Re: Producing library files from D

2013-05-31 Thread Regan Heath
On Fri, 31 May 2013 12:26:54 +0100, Shriramana Sharma 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 previous query abo

Re: Writing closed source programs in D?

2013-05-31 Thread Regan Heath
On Fri, 31 May 2013 12:25:48 +0100, Shriramana Sharma 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 the libraries (th

Re: and/or/not/xor operators

2013-05-31 Thread Regan Heath
On Fri, 31 May 2013 02:41:14 +0100, Shriramana Sharma wrote: Thanks to all who replied. On Thu, May 30, 2013 at 10:18 PM, bearophile wrote: But Walter refused them time ago on the basis that no one uses them in C++. So you can ask for them in the main D newsgroup, but I don't think yo

Re: and/or/not/xor operators

2013-05-31 Thread Regan Heath
On Thu, 30 May 2013 18:57:37 +0100, ixid wrote: On Thursday, 30 May 2013 at 16:30:12 UTC, Iain Buclaw wrote: On Thursday, 30 May 2013 at 16:18:44 UTC, Shriramana Sharma wrote: Hello. I have always loved the readability of C++'s and/or/not/xor word-like logical operators but It doesn't seem to

Re: My first D program

2013-05-30 Thread Regan Heath
On Thu, 30 May 2013 12:13:19 +0100, Shriramana Sharma 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 my first Hello Wo

Re: WinAPI callbacks and GC

2013-05-07 Thread Regan Heath
On Tue, 07 May 2013 00:03:58 +0100, Sean Kelly wrote: On May 2, 2013, at 6:17 AM, Regan Heath wrote: On Wed, 01 May 2013 01:12:39 +0100, Sean Kelly wrote: On Apr 23, 2013, at 2:21 PM, Jack Applegame wrote: According WinAPI documentation, CtrlHandler will be called in new

Re: WinAPI callbacks and GC

2013-05-02 Thread Regan Heath
On Wed, 01 May 2013 01:12:39 +0100, Sean Kelly wrote: On Apr 23, 2013, at 2:21 PM, Jack Applegame wrote: According WinAPI documentation, CtrlHandler will be called in new additional thread. Is it safe to allocate GC memory in NOT Phobos threads? If not, how to make it safe? I'm trying

Re: WinAPI callbacks and GC

2013-04-24 Thread Regan Heath
On Tue, 23 Apr 2013 22:21:27 +0100, Jack Applegame 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; } } ... SetConsoleCtrlHandler(&Ctr

Re: Ref and class function calls?

2013-04-17 Thread Regan Heath
On Wed, 17 Apr 2013 12:17:03 +0100, Tofu Ninja 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 it forces y

Re: Ref and class function calls?

2013-04-17 Thread Regan Heath
On Wed, 17 Apr 2013 12:02:25 +0100, Regan Heath 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 encapsulation makes the

Re: Ref and class function calls?

2013-04-17 Thread Regan Heath
On Tue, 16 Apr 2013 18:51:06 +0100, Tofu Ninja 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 agree tha

Re: Ref and class function calls?

2013-04-16 Thread Regan Heath
On Tue, 16 Apr 2013 15:57:09 +0100, Tofu Ninja 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 and behaviour: c

Re: SocketStream and weird 0xA character

2013-03-20 Thread Regan Heath
On Sun, 17 Feb 2013 16:53:23 -, Lubos Pintes 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 HTTP status line and

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 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 sense. Maybe this articl

Re: For DLLs, what does export actually do?

2013-02-11 Thread Regan Heath
On Sun, 10 Feb 2013 12:36:38 -, Ben Davis 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 dwDriverId, HDRVR

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

2013-01-30 Thread Regan Heath
On Wed, 30 Jan 2013 09:20:54 -, simendsjo 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 scope. You can mod

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 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 you mean struc

Re: MS ODBC encoding issue

2013-01-23 Thread Regan Heath
On Wed, 23 Jan 2013 04:41:11 -, Sam Hu 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 really database file.

Re: MS ODBC encoding issue

2013-01-23 Thread Regan Heath
On Wed, 23 Jan 2013 04:09:01 -, Sam Hu wrote: for windows console show Chinese character issue,I've solved and posted on the forum before.Please refer to below link: http://forum.dlang.org/thread/suzymdzjeifnfirtb...@dfeed.kimsufi.thecybershadow.net#post-suzymdzjeifnfirtbnrc:40dfeed.kimsu

Re: MS ODBC encoding issue

2013-01-17 Thread Regan Heath
On Mon, 14 Jan 2013 10:02:04 -, Regan Heath 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, solved t

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 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. Universal alphas are

Re: calling fgets()

2012-12-31 Thread Regan Heath
On Mon, 24 Dec 2012 12:00:05 -, Red 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, someStream); buff = buff[

Re: MS ODBC encoding issue

2012-12-31 Thread Regan Heath
On Mon, 24 Dec 2012 07:18:51 -, Sam Hu wrote: On Friday, 21 December 2012 at 15:20:39 UTC, Regan Heath wrote: On Wed, 19 Dec 2012 06:33:16 -, Sam Hu wrote: On Monday, 10 December 2012 at 14:43:08 UTC, Regan Heath wrote: > Ahh, of course. Now I'm having linking issues

Re: MS ODBC encoding issue

2012-12-21 Thread Regan Heath
On Wed, 19 Dec 2012 06:33:16 -, Sam Hu 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 wrote: On Thursday, 6 December 2012 at 16:44:01 UTC, Regan Heath wrote: On Thu, 06 Dec 2012 01:26:32 -, Sam Hu wrote: Known issues: Under console reading Access table recordsets works fine ,inserting a new record which contains only English

Re: MS ODBC encoding issue

2012-12-06 Thread Regan Heath
On Thu, 06 Dec 2012 01:26:32 -, Sam Hu 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 crash; If calling the f

Re: MS ODBC encoding issue

2012-12-05 Thread Regan Heath
On Wed, 05 Dec 2012 03:29:50 -, Sam Hu 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 functions too. BTW, convert sq

Re: VisualD solution configuration

2012-12-02 Thread Regan Heath
On Sun, 02 Dec 2012 15:08:51 -, Zhenya 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 you probably ne

Re: template ref parameter

2012-11-21 Thread Regan Heath
On Wed, 21 Nov 2012 12:32:24 -, Regan Heath wrote: On Wed, 21 Nov 2012 12:30:08 -, Regan Heath wrote: On Wed, 21 Nov 2012 12:02:45 -, Jack Applegame wrote: void foo(ref int a) { a--; } struct functor(A...) { void function(A) functor; } functor!int f;// functor

Re: template ref parameter

2012-11-21 Thread Regan Heath
On Wed, 21 Nov 2012 12:30:08 -, Regan Heath wrote: On Wed, 21 Nov 2012 12:02:45 -, Jack Applegame 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 implic

Re: template ref parameter

2012-11-21 Thread Regan Heath
On Wed, 21 Nov 2012 12:02:45 -, Jack Applegame 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 function(ref int a

Re: About demangling

2012-11-01 Thread Regan Heath
On Thu, 01 Nov 2012 17:21:29 -, H. S. Teoh wrote: On Thu, Nov 01, 2012 at 04:25:56PM -, Regan Heath wrote: On Thu, 01 Nov 2012 15:40:23 -, H. S. Teoh wrote: >On Thu, Nov 01, 2012 at 03:16:25PM +0100, Dan wrote: >>On Thursday, 11 October 2012 at 21:04:28 UTC, A

Re: About demangling

2012-11-01 Thread Regan Heath
On Thu, 01 Nov 2012 16:25:56 -, Regan Heath 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 s

Re: About demangling

2012-11-01 Thread Regan Heath
On Thu, 01 Nov 2012 15:40:23 -, H. S. Teoh 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 >> wrote: >> >>>Hi, >>>Can s

Re: About demangling

2012-11-01 Thread Regan Heath
On Thu, 01 Nov 2012 15:40:23 -, H. S. Teoh 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 >> wrote: >> >>>Hi, >>>Can s

Re: getters and setters not an lvalue

2012-10-31 Thread Regan Heath
On Wed, 31 Oct 2012 14:08:18 -, maarten van damme 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 the foreach loop, it cr

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 wrote: On Monday, 29 October 2012 at 12:31:56 UTC, Regan Heath wrote: On Mon, 29 Oct 2012 11:31:33 -, Sumit Raja wrote: Thanks both this works great for structs. Anything similar I can do for enums? Example? (The C/C++ code you&#x

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 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: Sort order of dirEntries

2012-10-26 Thread Regan Heath
On Thu, 25 Oct 2012 01:15:06 +0100, Joseph Rushton Wakeling 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 alphabetical order on some

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 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. I was curious so I had

Re: optlink and weak symbols

2012-10-18 Thread Regan Heath
On Thu, 18 Oct 2012 07:41:16 +0100, Jacob Carlborg 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 corresponding Windows

Re: OPTLINK bug (Re: Stack trace output on windows)

2012-10-17 Thread Regan Heath
On Wed, 17 Oct 2012 13:02:45 +0100, Benjamin Thaut wrote: Am 17.10.2012 13:56, schrieb Regan Heath: On Wed, 17 Oct 2012 12:43:27 +0100, Regan Heath wrote: On Wed, 17 Oct 2012 12:17:14 +0100, Benjamin Thaut wrote: I didn't go through the trouble and find out which versi

OPTLINK bug (Re: Stack trace output on windows)

2012-10-17 Thread Regan Heath
On Wed, 17 Oct 2012 12:43:27 +0100, Regan Heath wrote: On Wed, 17 Oct 2012 12:17:14 +0100, Benjamin Thaut wrote: I didn't go through the trouble and find out which version of dbghelp.dll exactly supports cv debugging symbols, but I know it depends on that. So I can not help you

Re: Stack trace output on windows

2012-10-17 Thread Regan Heath
On Wed, 17 Oct 2012 12:17:14 +0100, Benjamin Thaut wrote: I didn't go through the trouble and find out which version of dbghelp.dll exactly supports cv debugging symbols, but I know it depends on that. So I can not help you there. The linker line looks fine, looks the same for me but wor

Re: Stack trace output on windows

2012-10-17 Thread Regan Heath
On Tue, 16 Oct 2012 17:52:38 +0100, Benjamin Thaut 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 fo

Stack trace output on windows

2012-10-16 Thread Regan Heath
I have some C/C++ code which handles windows SEH exceptions and can output (in debug mode) a stack trace, for example: This process has performed an illegal operation and has to close. Exception code: 0xC005 Exception flags: 0x Exception address:0x00401CEF Number of p

Re: abnormal program termination

2012-08-30 Thread Regan Heath
On Wed, 29 Aug 2012 18:43:27 +0100, Ellery Newcomer 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 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 downloaded and installed p

Re: abnormal program termination

2012-08-29 Thread Regan Heath
On Wed, 29 Aug 2012 09:47:57 +0100, Regan Heath wrote: On Tue, 28 Aug 2012 21:03:47 +0100, Ellery Newcomer 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

Re: abnormal program termination

2012-08-28 Thread Regan Heath
On Tue, 28 Aug 2012 15:59:34 +0100, Ellery Newcomer wrote: On 08/28/2012 06:37 AM, Regan Heath wrote: On Sat, 25 Aug 2012 01:10:05 +0100, Ellery Newcomer 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

Re: abnormal program termination

2012-08-28 Thread Regan Heath
On Sat, 25 Aug 2012 01:10:05 +0100, Ellery Newcomer 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 program termination' is printed

  1   2   >