Re: How do I display unicode characters in D on standard (english) Windows 10 console window?

2019-07-30 Thread Martin Krejcirik via Digitalmars-d-learn
On Monday, 29 July 2019 at 22:31:01 UTC, kinke wrote: Switching the console code page to UTF-8, and then restoring the original one before termination. See https://github.com/ldc-developers/ldc/pull/3086/commits/5915534530fa095e7e5d58bcfb4ad100d249bbca#diff-c59e7716a40a08ce42f141c738f2c311. You

Re: How to debug long-lived D program memory usage?

2019-04-17 Thread Martin Krejcirik via Digitalmars-d-learn
On Wednesday, 17 April 2019 at 16:27:02 UTC, Adam D. Ruppe wrote: Each individual process eats ~30-100 MB, but that times 60 = trouble. They start off small, like 5 MB, and grow over weeks or months, so it isn't something I can easily isolate in a Do you run GC.minimize ?

Re: how to localize console and GUI apps in Windows

2018-01-03 Thread Martin Krejcirik via Digitalmars-d-learn
On Friday, 29 December 2017 at 11:14:39 UTC, zabruk70 wrote: AFAIK, Windows GUI have no ANSI/OEM problem. You can use Unicode. Be advised there are some problems with console UTF-8 input/output in Windows. The most usable is Win10 new console window but I recommend to use Windows API (WriteC

Re: The program exits unexpectedly

2016-12-09 Thread Martin Krejcirik via Digitalmars-d-learn
On Friday, 9 December 2016 at 16:50:05 UTC, unDEFER wrote: And in mini program it works and shows diagnostic message. Where my diagnostic message in more complicate program??? Try redirecting stdout and stderr to a file(s). There are cases when the console itself can crash.

Re: About debugging (again)

2016-10-17 Thread Martin Krejcirik via Digitalmars-d-learn
On Monday, 17 October 2016 at 15:45:56 UTC, ANtlord wrote: GDB 7.7.1 Use latest GDB, 7.10 has got much better D support.

Re: How to correctly display accented characters at the Windows prompt?

2016-10-10 Thread Martin Krejcirik via Digitalmars-d-learn
Windows. You can try command cp 65001 in the console window chcp 65001

Re: How to correctly display accented characters at the Windows prompt?

2016-10-10 Thread Martin Krejcirik via Digitalmars-d-learn
On Monday, 10 October 2016 at 19:31:14 UTC, Cleverson Casarin Uliana wrote: Hi Martin, indeed, here in my workplace Windows machine there is no "CP_UTF_8" codepage, nor there is 65001. I was waiting to codepage 65001 (UTF8) should be available on all modern Windows. You can try command cp 6500

Re: How to correctly display accented characters at the Windows prompt?

2016-10-10 Thread Martin Krejcirik via Digitalmars-d-learn
Thanks, Cleverson Call SetConsoleOutputCP(CP_UTF8). No, this may appear to to work, but in reality, it's broken. The only reliable way is to convert to the native windows codepage.

Re: Mysql-native with LAMPP

2016-09-12 Thread Martin Krejcirik via Digitalmars-d-learn
# netstat -npl | grep mysql unix 2 [ ACC ] STREAM LISTENING 239449 6293/mysqld /opt/lampp/var/mysql/mysql.sock Mysql defaults to unix socket, you need to add bind-address=127.0.0.1 to my.cnf [mysqld] section.

SList and DList init doesn't work in global variable

2015-09-28 Thread Martin Krejcirik via Digitalmars-d-learn
Is this intended or known issue ? It works with 2.066. SList!int gslist = [1,2,3,4,5,6]; // broken since 2.067 // Error: reinterpreting cast from NodeWithoutPayload* to Node* is not supported in CTFE DList!int gdlist = [1,2,3,4,5,6]; // broken since 2.067 // Error: non-constant expression ... vo

Re: Identifying and dealing with deprecated/removed language features

2015-09-20 Thread Martin Krejcirik via Digitalmars-d-learn
Dne 20. 9. 2015 v 11:55 Jacob Carlborg napsal(a): > I guess I can use __traits(compiles) to check if typedef and then insert > the "static if" with a string mixing. But is there a better way to do this? __VERSION__ ? -- mk

Re: Debugging D shared libraries

2015-09-20 Thread Martin Krejcirik via Digitalmars-d-learn
Dne 19. 9. 2015 v 18:41 Russel Winder via Digitalmars-d-learn napsal(a): > Indeed, it works well. Well for LDC. DMD and GDC are still broken. My > GDC problems are deeper that this code: Debian packages seem to have > weird problems and Fedora do not package GDC. All I need to do to make your exam

Re: foreach(line; f.byLine) produces core.exception.InvalidMemoryOperationError@(0) in 2.067 but not 2.066

2015-09-15 Thread Martin Krejcirik via Digitalmars-d-learn
On Tuesday, 15 September 2015 at 15:28:23 UTC, Andrew Brown wrote: A very naive question: would it be possible in this case to backport it into gdc/ldc by copying the pull request and building the compiler from source, or would this get me into a world of pain? Cherry-picking should work and

Re: foreach(line; f.byLine) produces core.exception.InvalidMemoryOperationError@(0) in 2.067 but not 2.066

2015-09-15 Thread Martin Krejcirik via Digitalmars-d-learn
For reference, it was this PR: https://github.com/D-Programming-Language/phobos/pull/3089 which fixed the same issue for me.

Re: foreach(line; f.byLine) produces core.exception.InvalidMemoryOperationError@(0) in 2.067 but not 2.066

2015-09-15 Thread Martin Krejcirik via Digitalmars-d-learn
On Tuesday, 15 September 2015 at 13:56:37 UTC, Andrwe Brown wrote: I'm trying to read a file line by line, and I get a core.exception.InvalidMemoryOperationError@(0), even after https://issues.dlang.org/show_bug.cgi?id=13856 Try DMD 2.068, it has got fixed byLine implementation.

Re: Incorrect display in Cyrillic Windows

2015-03-04 Thread Martin Krejcirik via Digitalmars-d-learn
On Wednesday, 4 March 2015 at 11:32:40 UTC, Dennis Ritchie wrote: Hi. It's normal for Windows? You have to set your console encoding to UTF-8 first. You can do it by command "chcp 65001" or by calling Windows API function: extern(Windows) BOOL SetConsoleOutputCP( UINT ); SetConsoleOutputCP(

Re: Will D have a serious dedicated well supported IDE like Visual Studio or Eclipse?

2015-02-27 Thread Martin Krejcirik via Digitalmars-d-learn
On Friday, 27 February 2015 at 07:08:26 UTC, Ali Çehreli wrote: What version of gdb is needed and is that version easy to install? Something from late 2014 or newer is the best (7.8.50-cvs or 7.9.50-cvs) as it has got Ian's patches merged, but even an old stock Debian gdb (7.4.1) works reaso

Re: floating point conversion

2014-06-01 Thread Martin Krejcirik via Digitalmars-d-learn
On 1.6.2014 18:02, Famous wrote: > This is different. The decimal 1.234 cannot be exacly represented as > radix-2 floating-point number. In your example above, a and b are not > equal. They are both approximations to 1.234 but the value of b is Still feels iffy to me. If you add: printf("%.70f

Re: floating point conversion

2014-06-01 Thread Martin Krejcirik via Digitalmars-d-learn
On 1.6.2014 16:42, Famous wrote: > from string should be the same, exacly, always. Casting a float to > double should be deterministic as well. void main() { float a = 1.234f; double b = 1.234; assert (a == cast(float) b); // fails in DMD x86, works in GDC, LDC } Maybe enhancement req

Re: floating point conversion

2014-06-01 Thread Martin Krejcirik via Digitalmars-d-learn
On 1.6.2014 14:45, bearophile wrote: > It's a bad question. Generally to compare floating point values for > equality use std.math.feqrel. So it's just a coincidence, that GDC, LDC x86 and also DMD x86_64 doesn't fail ? And this bug https://issues.dlang.org/show_bug.cgi?id=12831 should be marked

floating point conversion

2014-06-01 Thread Martin Krejcirik via Digitalmars-d-learn
import std.conv; void main() { float a = 1.23f; double b = to!float("1.23"); assert (a == b); // ??? } Should the assert fail or not ? (Please reply without trying first). If your reply is yes, should assert (a == to!float("1.23")) fail or not ? I'm bringing this up, because dmd an