Re: What's the latest GDC stable release version?

2024-06-17 Thread Dejan Lekic via Digitalmars-d-learn
On Sunday, 16 June 2024 at 16:26:08 UTC, mw wrote: Hi, What's the latest GDC stable release version? Stable release version is the same as stable GCC release version. Find it here: https://gcc.gnu.org/ (GDC is part of the GCC project for years)

Re: Feedback request from production of the usage of DWT

2024-06-13 Thread Dejan Lekic via Digitalmars-d-learn
On Thursday, 13 June 2024 at 06:59:49 UTC, Menjanahary R. R. wrote: How important is its adoption? Is GUI App in D frequent? There are quite few D GUI projects we are aware of, Tilix being one of the popular ones. I have few personal projects that are based, like Tilix, on GtkD

Re: How to use eventcore write an echo server?

2024-03-14 Thread Dejan Lekic via Digitalmars-d-learn
On Tuesday, 12 March 2024 at 05:13:26 UTC, zoujiaqing wrote: How to fix it? than you ;) Try the following: ``` class Connection { StreamSocketFD client; ubyte[1024] buf = void; // Add these two lines before the constructor: nothrow: @safe:

Re: C to D: please help translate this weird macro

2023-09-20 Thread Dejan Lekic via Digitalmars-d-learn
On Wednesday, 20 September 2023 at 13:55:14 UTC, Ki Rill wrote: On Wednesday, 20 September 2023 at 13:53:08 UTC, Ki Rill wrote: Here is the macro: ```C #define NK_CONTAINER_OF(ptr,type,member)\ (type*)((void*)((char*)(1 ? (ptr): &((type*)0)->member) - NK_OFFSETOF(type, member))) ``` I'm

Re: C to D: please help translate this weird macro

2023-09-20 Thread Dejan Lekic via Digitalmars-d-learn
On Wednesday, 20 September 2023 at 13:55:14 UTC, Ki Rill wrote: On Wednesday, 20 September 2023 at 13:53:08 UTC, Ki Rill wrote: Here is the macro: ```C #define NK_CONTAINER_OF(ptr,type,member)\ (type*)((void*)((char*)(1 ? (ptr): &((type*)0)->member) - NK_OFFSETOF(type, member))) ``` I'm

Re: Writing a simple text editor in D using a C tutorial

2023-08-29 Thread Dejan Lekic via Digitalmars-d-learn
On Tuesday, 29 August 2023 at 16:17:56 UTC, Răzvan Birișan wrote: Is there a better way to use `termios.h` inside D? Am I missing the point and there is a way to set these flags in D without using C libraries? I would try to use termios from druntime instead. Try: import

Re: wanting to try a GUI toolkit: needing some advice on which one to choose

2021-05-27 Thread Dejan Lekic via Digitalmars-d-learn
On Thursday, 27 May 2021 at 01:17:44 UTC, someone wrote: Yes, I know this is a question lacking a straightforward answer. Requirements: [...] I humbly believe the most complete one is GtKD. https://gtkdcoding.com/ https://gtkd.org We all wish there was a STANDARD D GUI library out there,

Re: dmd memory usage

2019-11-18 Thread Dejan Lekic via Digitalmars-d-learn
On Monday, 18 November 2019 at 00:20:12 UTC, Steven Schveighoffer wrote: I'm fighting some out of memory problems using DMD and some super-template heavy code. I have ideas on how to improve the situation, but it involves redesigning a large portion of the design. I want to do it

Re: SendMessageTimeoutW requires casting string to uint?

2019-07-09 Thread Dejan Lekic via Digitalmars-d-learn
On Tuesday, 9 July 2019 at 10:34:54 UTC, BoQsc wrote: All I know that there was toString16z function from tango project, that made it all work. Now that I browsed the std.utf more, I realised what fits your need best is the https://dlang.org/phobos/std_utf.html#toUTF16z

Re: SendMessageTimeoutW requires casting string to uint?

2019-07-09 Thread Dejan Lekic via Digitalmars-d-learn
On Tuesday, 9 July 2019 at 10:34:54 UTC, BoQsc wrote: I'm quite new to the programming, and I'm getting unsure how to make SendMessageTimeoutW to work with D lang. Most of my attention right now resides around the Argument of the SendMessageTimeoutW function: "Environment", It seems that

Re: SendMessageTimeoutW requires casting string to uint?

2019-07-09 Thread Dejan Lekic via Digitalmars-d-learn
On Tuesday, 9 July 2019 at 11:06:54 UTC, Dejan Lekic wrote: std.utf module has all encoding/decoding you need (in this case UTF-16). I guess You need to convert your string using toUTF16 ( https://dlang.org/phobos/std_utf.html#toUTF16 ). I do not do Windows programming so I am not 100% sure

Re: Singleton in Action?

2019-02-03 Thread Dejan Lekic via Digitalmars-d-learn
On Saturday, 2 February 2019 at 16:56:45 UTC, Ron Tarrant wrote: Hi guys, I ran into another snag this morning while trying to implement a singleton. I found all kinds of examples of singleton definitions, but nothing about how to put them into practice. Can someone show me a code example

Re: Optional parameters?

2018-04-04 Thread Dejan Lekic via Digitalmars-d-learn
On Sunday, 1 April 2018 at 15:54:16 UTC, Steven Schveighoffer wrote: I currently have a situation where I want to have a function that accepts a parameter optionally. This is what function overloading and/or default values are for, right?

Re: ndslice summary please

2017-04-13 Thread Dejan Lekic via Digitalmars-d-learn
On Thursday, 13 April 2017 at 10:00:43 UTC, 9il wrote: On Thursday, 13 April 2017 at 08:47:16 UTC, Ali Çehreli wrote: I haven't played with ndslice nor followed its deprecation discussions. Could someone summarize it for us please. Also, is it still used outside Phobos or is Ilya or someone

Re: Using Dub

2017-01-16 Thread Dejan Lekic via Digitalmars-d-learn
On Monday, 16 January 2017 at 09:40:55 UTC, Russel Winder wrote: On the one hand Cargo works wonderfully with Rust so I had hoped Dub would work wonderfully with D. Sadly I am finding it doesn't. Possibly my fault, but still annoying. Cargo does not have multiple Rust compilers as an option.

Re: [Semi-OT] I don't want to leave this language!

2016-12-07 Thread Dejan Lekic via Digitalmars-d-learn
On Monday, 5 December 2016 at 20:25:00 UTC, Ilya Yaroshenko wrote: Good D code should be nothrow, @nogc, and betterC. BetterC means that it must not require DRuntime to link and to start. I started Mir as scientific/numeric project, but it is going to be a replacement for Phobos to use D

Re: Build a SysTime from a string

2016-07-06 Thread Dejan Lekic via Digitalmars-d-learn
On Wednesday, 6 July 2016 at 14:15:22 UTC, Andrea Fontana wrote: My problem is that from documentation I can't understand how to set +01:00 timezone on systime. I guess I'm missing something... As far as I know, you can't do that. Quote from the documentation: """ Unlike DateTime, the time

Re: What's the secret to static class members

2016-06-30 Thread Dejan Lekic via Digitalmars-d-learn
On Thursday, 30 June 2016 at 01:11:09 UTC, Mike Parker wrote: I think it's safe to say this guy is just trolling and we can ignore him. I was about to say the same, Mike. He is either trolling, or genuinely did not even bother to learn some language basics...

Re: improve concurrent queue

2016-06-03 Thread Dejan Lekic via Digitalmars-d-learn
On Tuesday, 27 August 2013 at 17:35:13 UTC, qznc wrote: I can recommand this paper (paywalled though): http://dl.acm.org/citation.cfm?id=248106 The research paper can actually be freely downloaded from http://www.dtic.mil/cgi-bin/GetTRDoc?AD=ADA309412 . Good article, thanks!

Re: print function

2016-02-04 Thread Dejan Lekic via Digitalmars-d-learn
On Thursday, 4 February 2016 at 00:23:07 UTC, ixid wrote: It would be nice to have a simple writeln that adds spaces automatically like Python's 'print' in std.stdio, perhaps called print. There are many implementations of string interpolation in D (that is what you want, basically). One of

Re: Setting native OS thread name (eg, via prctl)

2015-12-22 Thread Dejan Lekic via Digitalmars-d-learn
Arun, isn't that what the 'name' property is there for?

Re: __traits(allMembers) and aliases

2015-08-25 Thread Dejan Lekic via Digitalmars-d-learn
It is off-topic (sorry for that), but how you grab only those (say functions) in a module that are annotated with @ChoseMe ?? allMembers trait gives bunch of strings, and I could not find a way to use them with hasUDA template...

Re: New to D - playing with Thread and false Sharing

2015-08-20 Thread Dejan Lekic via Digitalmars-d-learn
Keep in mind that in D everything is thread-local by default! :) For shared resources use __gshared or shared (although I do not know for sure whether shared works or not).

Re: How to use Fiber?

2015-02-25 Thread Dejan Lekic via Digitalmars-d-learn
On Tuesday, 24 February 2015 at 10:15:29 UTC, FrankLike wrote: There is a int[] ,how to use the Fiber execute it ? Such as : import std.stdio; import core.thread; class DerivedFiber : Fiber { this() { super( run ); } private : void run() { printf( Derived

Re: Beginner ?. Why does D suggest to learn java

2014-10-22 Thread Dejan Lekic via Digitalmars-d-learn
On Thursday, 16 October 2014 at 22:26:51 UTC, RBfromME wrote: I'm a newbie to programming and have been looking into the D lang as a general purposing language to learn, yet the D overview indicates that java would be a better language to learn for your first programming language. Why? Looks

Re: Allowing Expressions such as (low value high)

2014-09-09 Thread Dejan Lekic via Digitalmars-d-learn
On Thursday, 4 September 2014 at 20:03:57 UTC, Nordlöw wrote: Are there any programming languages that extend the behaviour of comparison operators to allow expressions such as if (low value high) ? This syntax is currently disallowed by DMD. I'm aware of the risk of a programmer

Re: ini library in OSX

2014-09-09 Thread Dejan Lekic via Digitalmars-d-learn
On Monday, 8 September 2014 at 06:32:52 UTC, Joel wrote: Is there any ini library that works in OSX? I've tried the ones I found. I think they have the same issue. Joels-MacBook-Pro:ChrisMill joelcnz$ dmd ini -unittest ini.d(330): Error: cannot pass dynamic arrays to extern(C) vararg

Re: ini library in OSX

2014-09-09 Thread Dejan Lekic via Digitalmars-d-learn
Or this one: http://dpaste.dzfl.pl/1b29ef20#

Re: Installing LDC on Windows

2014-09-09 Thread Dejan Lekic via Digitalmars-d-learn
On Saturday, 6 September 2014 at 11:13:20 UTC, Russel Winder via Digitalmars-d-learn wrote: OK I installed LDC pre-built on MinGW for Windows on Windows and then Installed MinGW for Windows but when I run ldc2 it tells me libgcc_s_dw2-1.dll is missing. Is this problem soluble by any means

Re: dmd with shared lib

2014-05-26 Thread Dejan Lekic via Digitalmars-d-learn
bioinfornatics wrote: Hi, after building and installing dmd i fail to use generated executable because they are an undefined symbol. $ /opt/dmd/bin/dmd -L-lcurl testDelegate.d $ ./testDelegate ./testDelegate: symbol lookup error: /opt/dmd/lib/libphobos2.so.0.66: undefined symbol:

Re: DFL is the best UIcontrols for D,compare it to dwt, tkd,dtk,dlangui,anchovy......

2014-05-14 Thread Dejan Lekic via Digitalmars-d-learn
Although DFL not use on Linux or Mac os X,it's easy to do for high level Software Engineer. Well, go ahead and do it!

Re: Any chance to avoid monitor field in my class?

2014-05-14 Thread Dejan Lekic via Digitalmars-d-learn
On Tuesday, 13 May 2014 at 17:41:42 UTC, Yuriy wrote: On Tuesday, 13 May 2014 at 17:09:01 UTC, Daniel Murphy wrote: What exactly is the mangling problem with extern(C++) classes? Can't use D arrays (and strings) as function argument types. Can't use D array types as template arguments. extern