Re: hunt-examples/website-basic

2024-01-17 Thread Heromyth via Digitalmars-d-learn
On Saturday, 29 April 2023 at 18:05:20 UTC, Vino B wrote: Hi All, Request your help, while trying to compile the hunt-examples/website-basic, I am facing with the below error(https://github.com/huntlabs/hunt-examples/tree/master/website-basic). Error ```

Re: GC memory fragmentation

2021-11-03 Thread Heromyth via Digitalmars-d-learn
On Wednesday, 14 April 2021 at 12:47:22 UTC, Heromyth wrote: On Sunday, 11 April 2021 at 09:10:22 UTC, tchaloupka wrote: Hi, we're using vibe-d (on Linux) for a long running REST API server and have problem with constantly growing memory until system kills it with OOM killer. The Hunt

Re: GC memory fragmentation

2021-04-14 Thread Heromyth via Digitalmars-d-learn
On Sunday, 11 April 2021 at 09:10:22 UTC, tchaloupka wrote: Hi, we're using vibe-d (on Linux) for a long running REST API server and have problem with constantly growing memory until system kills it with OOM killer. The Hunt Framework is also suffering from this. We are trying to make a

Re: How to get the UDAs for a function parameter correctly?

2020-05-10 Thread Heromyth via Digitalmars-d-learn
On Monday, 11 May 2020 at 02:34:32 UTC, Adam D. Ruppe wrote: On Monday, 11 May 2020 at 02:25:39 UTC, Heromyth wrote: I want to get the UDAs for for a function parameter. Here the test code and I got some errors: I think my blog aside is one of the few if only write-ups on how to do this:

How to get the UDAs for a function parameter correctly?

2020-05-10 Thread Heromyth via Digitalmars-d-learn
I want to get the UDAs for for a function parameter. Here the test code and I got some errors: source/app.d(29,33): Error: first argument is not a symbol source/app.d(39,15): Error: template instance app.test!(ClassA) error instantiating How can I fix this? Would this be a bug? Thanks.

Re: Why can meson find hunt-net but not hunt-proton in dependency resolution?

2020-04-01 Thread Heromyth via Digitalmars-d-learn
On Wednesday, 1 April 2020 at 02:27:38 UTC, YD wrote: Thanks for the reply! BTW is hunt-amqp for AMQP 1.0 only? Because when I try it on an AMQP 0.9 server, it does not seem to connect. Thanks again! We are using RabbitMQ v3.8.2 for test. The hunt-amqp is based on AMQP 1.0, and is not tested

Re: Why can meson find hunt-net but not hunt-proton in dependency resolution?

2020-03-31 Thread Heromyth via Digitalmars-d-learn
On Wednesday, 1 April 2020 at 01:21:22 UTC, YD wrote: On Tuesday, 31 March 2020 at 19:59:25 UTC, YD wrote: [...] So I found that the issue is that dub.json file in hunt-proton has an entry referring to the parent package with a relative file path in it. When that relative file path is

Re: Some code that compiles but shouldn't

2019-12-30 Thread Heromyth via Digitalmars-d-learn
On Monday, 30 December 2019 at 18:18:49 UTC, uranuz wrote: I have created library/ framework to handle JSON-RPC requests using D methods. I use some *template magic* to translate JSON-RPC parameters and return values from/ and to JSON. And I have encountered funny bug that at first was hard to

Re: Deserializing JSON as an abstract type

2019-11-18 Thread Heromyth via Digitalmars-d-learn
On Tuesday, 19 November 2019 at 00:40:16 UTC, Chris wrote: So I'm trying to make a D wrapper for Telegram's JSON API using libtdjson. All results coming from the JSON API take the following structure: { "@type": "className", "foo": "bar", "baz" { "@type": "otherClass" } } where

Re: Translating Java into D

2019-11-15 Thread Heromyth via Digitalmars-d-learn
On Friday, 15 November 2019 at 13:15:29 UTC, Andre Pany wrote: On Friday, 15 November 2019 at 03:29:16 UTC, Heromyth wrote: On Thursday, 14 November 2019 at 19:50:22 UTC, NonNull wrote: Greetings, Java seems to be almost a subset of D in various ways. No, it's not exactly right. Java is more

Re: Translating Java into D

2019-11-14 Thread Heromyth via Digitalmars-d-learn
On Thursday, 14 November 2019 at 19:50:22 UTC, NonNull wrote: Greetings, Java seems to be almost a subset of D in various ways. No, it's not exactly right. Java is more powerful than D as for a language. Many things that Java can do can't be done by D. For example, reflection, full meta info

Re: Mimicking Java's Type Erasure

2019-11-03 Thread Heromyth via Digitalmars-d-learn
On Monday, 4 November 2019 at 00:16:53 UTC, Superstar64 wrote: Consider the following Java code. -- import java.util.function.Function; public class Main{ //basic Rank2 type static interface Stringer{ String show(Function type, A that); } static class Say implements

Re: How to replace the main thread with custom thread

2019-05-04 Thread Heromyth via Digitalmars-d-learn
On Sunday, 5 May 2019 at 05:49:07 UTC, Heromyth wrote: We have made some extensions to std.thread. See: https://github.com/huntlabs/hunt/blob/master/source/hunt/concurrency/thread/ThreadEx.d. All the threads except the main thread now can be created with ThreadEx. My question is how can I

How to replace the main thread with custom thread

2019-05-04 Thread Heromyth via Digitalmars-d-learn
We have made some extensions to std.thread. See: https://github.com/huntlabs/hunt/blob/master/source/hunt/concurrency/thread/ThreadEx.d. All the threads except the main thread now can be created with ThreadEx. My question is how can I create the main thread with ThreadEx. Is it possible or

Re: Why does D language do not support BigDecimal type?

2019-03-11 Thread Heromyth via Digitalmars-d-learn
On Monday, 11 March 2019 at 15:23:34 UTC, BoQsc wrote: There is Money datatype that can be provided by using a third party package: https://code.dlang.org/packages/money But that's only for money, what about math? Why such fundamental as BigDecimal is still not included into the D language

Re: Using Async task with timer

2019-02-05 Thread Heromyth via Digitalmars-d-learn
On Wednesday, 6 February 2019 at 05:03:26 UTC, Sudhi wrote: Hi All, I am trying to use an Async task which would run at every interval of time. I could not find any example for this. Can some one enlighten me on this. I did not find much documentation on timers also. Thanks, Sudhi Here

Re: reimplementing an interface in a derived class

2019-01-09 Thread Heromyth via Digitalmars-d-learn
On Thursday, 3 January 2019 at 23:23:12 UTC, Neia Neutuladh wrote: On Thu, 03 Jan 2019 22:30:48 +, kdevel wrote: class A : D { int foo() { return 1; } } class B : A, D { [...] What is the meaning of the ", D"? It does not seem to make a difference if it is omitted. B must provide

Re: How to initialize a globle variable nicely and properly?

2018-12-15 Thread Heromyth via Digitalmars-d-learn
On Saturday, 15 December 2018 at 03:48:15 UTC, Neia Neutuladh wrote: On Sat, 15 Dec 2018 02:54:55 +, Heromyth wrote: shared static this() { writeln("running A in shared static this(), sharedField=", sharedField); Thread th = new Thread(() { }); th.start();

How to initialize a globle variable nicely and properly?

2018-12-14 Thread Heromyth via Digitalmars-d-learn
We have a module including many globle variables which are needed to be initialized firstly in "shared static this() {}", see here https://github.com/huntlabs/hunt/blob/master/source/hunt/time/Init.d. The problem is that these variables are not always initialized firstly when are referenced

Re: How do I use null in a struct?

2018-11-11 Thread Heromyth via Digitalmars-d-learn
On Saturday, 10 November 2018 at 19:42:47 UTC, Václav Kozák wrote: I'm making a Rest API with vibe.d and I have a struct User. Sometimes I need to return only a few of the fields. So for example: return User(1, null, "John", null, null, ...); If I do this, an error occurs: cannot implicitly

Help needed to extend the core.thread

2018-10-25 Thread Heromyth via Digitalmars-d-learn
I want make some extensions to Thread in core.thread and wan. So I copy the whole of core.thread to another module named myext.thread. Here are two errors occurred: 1)When building this module In function `_D4myext6thread6Thread9termLocksFNiZv': /home/dlang/UnitTest/source/myext/thread.d:1723:

Re: Help about Template and class inheritance

2018-10-14 Thread Heromyth via Digitalmars-d-learn
On Sunday, 14 October 2018 at 15:06:49 UTC, Basile B. wrote: The basic problem you're faced to here is that D class / interface member functions that are templatized are never virtual. I'm not sure if i understand well the JAVA pattern you try to reproduce but since D interfaces can be

Help about Template and class inheritance

2018-10-14 Thread Heromyth via Digitalmars-d-learn
Here is a sample code ```d import std.stdio; class Future(T) { T result; this(T r) { this.result = r; } } interface IExecutorService { // Future!(T) submit(T)(T result); // can't be implemented } abstract class ExecutorService :

Re: Is there an efficient byte buffer queue?

2018-10-14 Thread Heromyth via Digitalmars-d-learn
On Monday, 8 October 2018 at 09:39:55 UTC, John Burton wrote: My use case is sending data to a socket. We have ported some containers from JAVA. ByteBuffer is a basic container interface and widely used in JAVA. See also:

Re: Is there websocket client implementation for D

2018-09-10 Thread Heromyth via Digitalmars-d-learn
On Tuesday, 24 March 2015 at 17:55:38 UTC, Ilya Korobitsyn wrote: Hello! Is there any websocket client implementation in D? I know there is WS server as a part of vibe.d, but it does not seem to include client. Maybe there are some library bindings that I've missed? We just implemented one

Re: How to list all the manifest constants in a class or struct

2018-06-17 Thread Heromyth via Digitalmars-d-learn
On Sunday, 17 June 2018 at 20:03:09 UTC, aliak wrote: On Sunday, 17 June 2018 at 02:44:38 UTC, Heromyth wrote: [...] I think this bolts.isManifestAssignable [1] will get you partially there. The place where it'll fail though is a static immutable (since they are assignable to manifest

Re: How to list all the manifest constants in a class or struct

2018-06-17 Thread Heromyth via Digitalmars-d-learn
On Sunday, 17 June 2018 at 04:32:29 UTC, Jonathan M Davis wrote: On Sunday, June 17, 2018 02:44:38 Heromyth via Digitalmars-d-learn wrote: Here is a struct named S: struct S { enum X = 10; enum Y { i = 10 } enum Z = "str"; struct S {} class C {} static

How to list all the manifest constants in a class or struct

2018-06-16 Thread Heromyth via Digitalmars-d-learn
Here is a struct named S: struct S { enum X = 10; enum Y { i = 10 } enum Z = "str"; struct S {} class C {} static int sx = 0; __gshared int gx = 0; shared void g(); } I want list all then the

Re: debugging in vs code on Windows

2017-10-14 Thread Heromyth via Digitalmars-d-learn
On Saturday, 14 October 2017 at 19:01:52 UTC, piotrklos wrote: On Saturday, 14 October 2017 at 13:12:51 UTC, Jerry wrote: On Friday, 13 October 2017 at 12:55:09 UTC, piotrklos wrote: (...) If you use generate a 32-bit binary using DMD, it generates it in a format that the C/C++ extension