Error: char 0x200b not allowed in identifier

2019-06-03 Thread zoujiaqing via Digitalmars-d-learn
Error for code: source/hunt/xml/Element.d(12,13): Error: char 0x200b not allowed in identifier source/hunt/xml/Element.d(12,23): Error: character 0x200b is not a valid token source/hunt/xml/Element.d(17,15): Error: char 0x200b not allowed in identifier source/hunt/xml/Element.d(17,26): Error:

Re: Error: char 0x200b not allowed in identifier

2019-06-03 Thread zoujiaqing via Digitalmars-d-learn
On Monday, 3 June 2019 at 14:41:18 UTC, ag0aep6g wrote: On 03.06.19 15:37, zoujiaqing wrote: Error for code: source/hunt/xml/Element.d(12,13): Error: char 0x200b not allowed in identifier U+200B is: ZERO WIDTH SPACE. Somehow you got that invisible character into your code. You have to get

How to use template Object in interface?

2019-06-25 Thread zoujiaqing via Digitalmars-d-learn
hunt-cache current version use template implemention adapter changes. I want use Interface to define Adapter, this master code unable to comple. How to do it? D programming language design flaws? ```bash git clone https://github.com/huntlabs/hunt-cache cd hunt-cache/example dub run -v ...

Re: How to convert array of structs to JSON

2019-06-25 Thread zoujiaqing via Digitalmars-d-learn
On Tuesday, 25 June 2019 at 05:33:57 UTC, mark wrote: I have the following array of structs: struct Person { string name; int age; }; Person people[]; Person p; Person p1 = { "Bob", 12 }; Person p2 = { "Bob", 12 }; people ~= p1; people ~= p2; I've read through the

Re: How to use template Object in interface?

2019-06-25 Thread zoujiaqing via Digitalmars-d-learn
On Tuesday, 25 June 2019 at 12:11:47 UTC, zoujiaqing wrote: hunt-cache current version use template implemention adapter changes. I want use Interface to define Adapter, this master code unable to comple. How to do it? D programming language design flaws? ```bash git clone

Re: is there any micro-service library in D?

2019-06-25 Thread zoujiaqing via Digitalmars-d-learn
On Wednesday, 19 June 2019 at 08:29:15 UTC, dangbinghoo wrote: hi there, Does anyone know the micro-service oriented design library or framework in D? thanks! binghoo dang You can try hunt-service: hunt-service is distributed RPC framework for DLang based on gRPC and neton.

Re: How to use template Object in interface?

2019-06-26 Thread zoujiaqing via Digitalmars-d-learn
On Tuesday, 25 June 2019 at 12:11:47 UTC, zoujiaqing wrote: hunt-cache current version use template implemention adapter changes. I want use Interface to define Adapter, this master code unable to comple. How to do it? D programming language design flaws? ```bash git clone

Re: D on ARM laptops?

2019-07-04 Thread zoujiaqing via Digitalmars-d-learn
On Thursday, 4 July 2019 at 07:46:53 UTC, Paolo Invernizzi wrote: On Thursday, 4 July 2019 at 01:01:03 UTC, Nicholas Wilson wrote: On Wednesday, 3 July 2019 at 20:49:20 UTC, JN wrote: Does anyone know if and how well D works on ARM laptops (such as Chromebooks and similar)? For example this

Re: Dmd install to new Windows 10 system can't run app.d

2019-11-21 Thread zoujiaqing via Digitalmars-d-learn
On Thursday, 21 November 2019 at 08:42:39 UTC, Seb wrote: On Thursday, 21 November 2019 at 08:30:33 UTC, zoujiaqing wrote: 1. Download dmd.2.088.1.windows.7z 2. Unzip it to D:\Develop\dmd2 3. Add ENV D:\Develop\dmd2\windows\bin to System Path 4. Run `dub --version` and `dmd --version` in

Re: Dmd install to new Windows 10 system can't run app.d

2019-11-21 Thread zoujiaqing via Digitalmars-d-learn
On Thursday, 21 November 2019 at 08:42:39 UTC, Seb wrote: Note this line: Running .\myproject.exe Program exited with code -1073741515 Your compiled program is crashing. Could you run the compiled binary manually and obtain a stack trace? x86 is OK, but x64 bad. PS

Re: Dmd install to new Windows 10 system can't run app.d

2019-11-21 Thread zoujiaqing via Digitalmars-d-learn
On Thursday, 21 November 2019 at 08:42:39 UTC, Seb wrote: Note this line: Running .\myproject.exe Program exited with code -1073741515 Your compiled program is crashing. Could you run the compiled binary manually and obtain a stack trace? Install msvcr100.dll for x64 the question is

Re: How to get child class Type and members from parent class?

2019-11-21 Thread zoujiaqing via Digitalmars-d-learn
On Wednesday, 20 November 2019 at 22:26:17 UTC, Adam D. Ruppe wrote: On Wednesday, 20 November 2019 at 20:57:56 UTC, Matheus wrote: This is a different way of designing things, do people use this often? This is really only useful sometimes. It is important to notice that if you do class C :

Dmd install to new Windows 10 system can't run app.d

2019-11-21 Thread zoujiaqing via Digitalmars-d-learn
1. Download dmd.2.088.1.windows.7z 2. Unzip it to D:\Develop\dmd2 3. Add ENV D:\Develop\dmd2\windows\bin to System Path 4. Run `dub --version` and `dmd --version` in powershell is OK 5. dub ini myproject (no dependency) 6. Run `cd myproject` and `dub run` is error... Error Logging infomation:

Re: PHP to D Conversion

2019-10-21 Thread zoujiaqing via Digitalmars-d-learn
On Friday, 18 October 2019 at 06:22:33 UTC, Vino wrote: Hi All, Request your help in converting a PHP code to D equivalent code PHP Code: class avmtest { private $con; function __construct() { global $config; $this->con = new

Re: PHP to D Conversion

2019-10-21 Thread zoujiaqing via Digitalmars-d-learn
On Monday, 21 October 2019 at 15:36:25 UTC, Andre Pany wrote: On Monday, 21 October 2019 at 15:29:33 UTC, zoujiaqing wrote: On Friday, 18 October 2019 at 06:22:33 UTC, Vino wrote: [...] import hunt.database; class avmtest { private Database db; this() { db = new

Re: PHP to D Conversion

2019-10-21 Thread zoujiaqing via Digitalmars-d-learn
On Friday, 18 October 2019 at 06:22:33 UTC, Vino wrote: Hi All, Request your help in converting a PHP code to D equivalent code You can get one connection object and close it :) ```D import hunt.database; class AvmTest { private Database _db; this() { _db = new

How to get child class Type and members from parent class?

2019-11-20 Thread zoujiaqing via Digitalmars-d-learn
import std.stdio; class A { this(T)(T t) { } void write() { T _this = cast(T) this; writeln(this.v); } } class B : A { string v = "hello"; } void main() { auto b = new B; writeln(b.write()); // print hello }

Re: Dub - vibe.d - hunt framework ... problems

2020-02-06 Thread zoujiaqing via Digitalmars-d-learn
On Saturday, 1 February 2020 at 10:35:52 UTC, seany wrote: Hi I want to start a small server, that will be accessible form outside. Not a huge deal right? Not quite. My machine: 4.15.0-66-generic #75-Ubuntu SMP Tue Oct 1 05:24:09 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux DMD : DMD64 D

Re: Bind C++ class to DLang : undefined reference to `Canvas::Foo()'

2020-07-13 Thread zoujiaqing via Digitalmars-d-learn
I changed string to basic_string. /// source/main.d import std.stdio; import core.stdcpp.string; extern(C++) { class Canvas { @disable this(); static Canvas Create(); basic_string!ubyte Foo(); basic_string!ubyte Bar(); }; } void main() {

Re: Bind C++ class to DLang : undefined reference to `Canvas::Foo()'

2020-07-13 Thread zoujiaqing via Digitalmars-d-learn
On Monday, 13 July 2020 at 12:57:52 UTC, Adam D. Ruppe wrote: On Monday, 13 July 2020 at 09:34:35 UTC, zoujiaqing wrote: # dmd source/main.d Canvas.o -L-lstdc++ && ./main [1]49078 segmentation fault ./main On my computer I got this warning out of the compiler: libstdc++

Bind C++ class to DLang : undefined reference to `Canvas::Foo()'

2020-07-12 Thread zoujiaqing via Digitalmars-d-learn
/// Canvas.hpp #include ; class Canvas { static Canvas* Create(); std::string Foo(); std::string Bar(); }; /// Canvas.cpp #include "Canvas.hpp" #include Canvas* Canvas::Create() { return new Canvas(); } std::string Canvas::Foo() { return "Foo"; } std::string