Re: bool passed by ref, safe or not ?

2024-06-05 Thread Kagamin via Digitalmars-d-learn
On Wednesday, 5 June 2024 at 01:18:06 UTC, Paul Backus wrote: The only safe values for a `bool` are 0 (false) and 1 (true). AFAIK that was fixed and now full 8-bit range is safe.

Re: How to pass in reference a fixed array in parameter

2024-06-05 Thread Kagamin via Digitalmars-d-learn
On Tuesday, 4 June 2024 at 12:22:23 UTC, Eric P626 wrote: I try to create a 2D array of fixed length and pass it in parameter as a reference. Normally, in C, I would have used a pointer as parameter, and pass the address of the array. Not obvious what you're trying to do. How would you do it i

Re: How to pass in reference a fixed array in parameter

2024-06-05 Thread Kagamin via Digitalmars-d-learn
With accessor: ``` void main() { s_cell[] maze=make(5,5); s_cell a=maze.get(1,2); print_maze(maze); } void print_maze(s_cell[] maze) { } s_cell[] make(int width, int height) { return new s_cell[width*height]; } s_cell get(s_cell[] maze, int x, int y) { return maze[5*y+x]; //

Re: How to use D without the GC ?

2024-06-11 Thread Kagamin via Digitalmars-d-learn
1) arena allocator makes memory manageable with occasional cache invalidation problem 2) no hashtable no problem 3) error handling depends on your code complexity, but even in complex C# code I found exceptions as boolean: you either have an exception or you don't 4) I occasionally use CTFE, w

Re: Why `foo.x.saa.aa` and `foo.y.saa.aa` is the same? `shared_AA.saa` should still be instance variable, not class variable, right?

2024-06-24 Thread Kagamin via Digitalmars-d-learn
It's a bug.

Re: freebsd dub linker error

2022-06-01 Thread Kagamin via Digitalmars-d-learn
Try to run clang with -v option and compare with gcc.

Re: How to debug thread code

2022-07-12 Thread Kagamin via Digitalmars-d-learn
On Sunday, 10 July 2022 at 21:27:08 UTC, Hipreme wrote: "Your app has entered a break state, but there is no code to show because all threads were executing external code (typically system or framework code)." Open the threads window and click on threads there, their stack will be in the stac

Re: null == "" is true?

2022-07-18 Thread Kagamin via Digitalmars-d-learn
On Tuesday, 12 July 2022 at 20:36:03 UTC, Antonio wrote: Honestly, it is difficult to understand for newcomers... there is a reason, but there is a reason in javascript for `0 == ''` too People would have different preferences there. Difference between null and empty is useless. D does the ri

Re: null == "" is true?

2022-07-19 Thread Kagamin via Digitalmars-d-learn
On Monday, 18 July 2022 at 21:23:32 UTC, Antonio wrote: I will study it in detail and report (if required). May be, I will write the DTO problem with D article if I find time in august. In my experience null and empty in DTOs usually play the same logical role. It's a very contrived technical

Re: null == "" is true?

2022-07-19 Thread Kagamin via Digitalmars-d-learn
On Tuesday, 19 July 2022 at 10:29:40 UTC, Antonio wrote: The summary is that a DTO that works like a Map needs to represent the absent key ant this is not the same that the Null value Example: ```d struct Null { /*...*/ } struct Undefined { /*...*/ } struct ContactDto { DtoVal!(Undefined, str

Re: null == "" is true?

2022-07-19 Thread Kagamin via Digitalmars-d-learn
Also what's the difference between null and empty phone number?

Re: null == "" is true?

2022-07-20 Thread Kagamin via Digitalmars-d-learn
On Tuesday, 19 July 2022 at 18:05:34 UTC, Antonio wrote: In a relational database, `NULL` is not the same that `""`... and `NULL` is not the same that `0`. Are semantically different and there are database invariants (like foreign keys) based on it. Trying to "mix" this concepts in a databas

Re: char* pointers between C and D

2022-07-25 Thread Kagamin via Digitalmars-d-learn
This is how to do it the D way: ``` int main(string[] args) { string ch1 = "Hello World!"; char[] ch2="Hello World!".dup; string s1=ch1[1..$]; char[] s2=ch2[1..$]; writeln(s1); writeln(s2); return 0; } ```

Re: toString doesn't compile with -dip1000 switch

2022-08-01 Thread Kagamin via Digitalmars-d-learn
Bar.toString is typed `@system`.

Re: How to workaround on this (bug?)

2022-09-23 Thread Kagamin via Digitalmars-d-learn
Provide two functions and let the caller choose ``` void fun(ref Variant v) nothrow { } void fun2(Variant v) { fun(v); } ```

Re: Static executable (ldc, linux)

2022-10-25 Thread Kagamin via Digitalmars-d-learn
ldc2 -link-defaultlib-shared=false or something like that

Re: Is "auto t=T();" not the same as "T t;"?

2022-10-26 Thread Kagamin via Digitalmars-d-learn
Looks like explicitly initialized variable in this case allocates array literal. Uninitialized variable is initialized with init pattern. This may be correct as uninitialized variable isn't guaranteed to hold a value most useful for you, it's only guaranteed to hold a defined value.

Re: dub ldc2 static linking

2022-10-28 Thread Kagamin via Digitalmars-d-learn
On Friday, 28 October 2022 at 02:46:42 UTC, ryuukk_ wrote: I'm just right now having an issue with glibc version mismatch for my server Just compile with an old enough glibc, 2.14 works for me.

Re: Make IN Dlang

2022-11-02 Thread Kagamin via Digitalmars-d-learn
On Tuesday, 1 November 2022 at 23:40:22 UTC, Christian Köstlin wrote: I am still trying to find answers to the following questions: 1. Is it somehow possible to get rid of the dub single file scheme, and e.g. interpret a full dlang script at runtime? If there was an interpreter like ``` #!

Re: Make IN Dlang

2022-11-02 Thread Kagamin via Digitalmars-d-learn
But embedded sdl is likely to be dwarfed by the actual code anyway.

Re: Make IN Dlang

2022-11-02 Thread Kagamin via Digitalmars-d-learn
Another idea is to separate the script and interpreter then compile them together. ``` --- interp.d --- import script; import ...more stuff ...boilerplate code int main() { interpret(script.All); return 0; } --- script.d --- #! ? module script; import mind; auto All=Task(...); ...more decla

Re: aa.keys, synchronized and shared

2022-11-11 Thread Kagamin via Digitalmars-d-learn
Try this: ``` synchronized final class SyncAA(K, V) { V opIndex(K key) { return sharedTable[key]; } V opIndexAssign(V value, K key) { return sharedTable[key]=value; } const(K[]) keys() const { return unsharedTable.keys; } void remove(K key) { sharedTable.remove(key); }

Re: aa.keys, synchronized and shared

2022-11-11 Thread Kagamin via Digitalmars-d-learn
With allocation: ``` synchronized final class SyncAA(K, V) { V opIndex(K key) { return sharedTable[key]; } V opIndexAssign(V value, K key) { return sharedTable[key]=value; } const(K[]) keys() const { return unsharedTable.keys; } void remove(K key) { sharedTable.remove(ke

Re: aa.keys, synchronized and shared

2022-11-14 Thread Kagamin via Digitalmars-d-learn
This works for me: ``` synchronized final class SyncAA(K, V) { this(K key, V val) { sharedTable[key]=val; } V opIndex(K key) { return sharedTable[key]; } V opIndexAssign(V value, K key) { return sharedTable[key]=value; } const(K[]) keys() const { return unsharedTable.key

Re: How often I should be using const? Is it useless/overrated?

2022-11-22 Thread Kagamin via Digitalmars-d-learn
On Friday, 18 November 2022 at 17:57:25 UTC, H. S. Teoh wrote: You're looking at it the wrong way. The kind of issues having const would solve is like when your function takes parameters x, y, z, and somewhere deep in the function you see the expression `x + y*z`. If x, y, and z are const, the

Re: Logging logs in Windows

2023-02-07 Thread Kagamin via Digitalmars-d-learn
On Saturday, 4 February 2023 at 13:31:41 UTC, Alexander Zhirov wrote: I understand that programming under Windows is a shame for a programmer, but is there really no ready-made solution for using the system log in Windows? It would be a logging library like log4j that would have different log

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-02-10 Thread Kagamin via Digitalmars-d-learn
On Monday, 23 January 2023 at 00:36:36 UTC, thebluepandabear wrote: It's not a freedom issue, it's a library-design issue. Some libraries want to incorporate a namespace-like design to force the user to be more 'explicit' with what they want. SFML has a `Keyboard` namespace which has a `Key` e

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-02-10 Thread Kagamin via Digitalmars-d-learn
On Friday, 10 February 2023 at 14:17:25 UTC, Kagamin wrote: Pretty sure you can strip namespaces in any language that has namespaces, C# routinely does it and refers to all types with their nonqualified names. It even has Keys enum: https://learn.microsoft.com/en-us/dotnet/api/system.windows.fo

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-02-12 Thread Kagamin via Digitalmars-d-learn
On Friday, 10 February 2023 at 21:52:02 UTC, ProtectAndHide wrote: Well in Swift, there is no problem .. at all. Why is it a problem in D then? (and I mean technically). What about the increment operator `++` ?

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-02-13 Thread Kagamin via Digitalmars-d-learn
On Monday, 13 February 2023 at 08:22:06 UTC, ProtectAndHide wrote: Chris Lattner outlines the reasons for removing it in Swift 3.0 here: https://github.com/apple/swift-evolution/blob/main/proposals/0004-remove-pre-post-inc-decrement.md So your complaint is that you agree with Chris Lattner an

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-02-14 Thread Kagamin via Digitalmars-d-learn
My point is you know you're just picky.

[OT] (Go) Do I read it right?

2023-02-16 Thread Kagamin via Digitalmars-d-learn
https://github.com/dominikh/go-tools/issues/917 How go programmers cope with this feature?

Re: Best way to read/write Chinese (GBK/GB18030) files?

2023-03-14 Thread Kagamin via Digitalmars-d-learn
On Monday, 13 March 2023 at 00:32:07 UTC, zjh wrote: Thank you for your reply, but is there any way to output `gbk` code to the console? I guess if your console is in gbk encoding, you can just write bytes with stdout.write.

Re: Threads

2023-03-22 Thread Kagamin via Digitalmars-d-learn
static is thread local by default. ``` module main; import app; import core.thread; int main(string[] args) { static shared int result; static shared string[] args_copy; static void app_thread() { App app = new App(); result = app.run(args_copy); }

Re: Best way to read/write Chinese (GBK/GB18030) files?

2023-03-22 Thread Kagamin via Digitalmars-d-learn
https://dlang.org/phobos/std_stdio.html#rawWrite

Re: Convert binary to UUID from LDAP

2023-03-28 Thread Kagamin via Digitalmars-d-learn
This guid is (int,short,short,byte[8]) in little endian byte order. So if you want to convert it to big endian, you'll need to swap bytes in those int and two shorts. ``` ubyte[] guid=... int* g1=cast(int*)guid.ptr; *g1=bswap(*g1); ```

Re: Convert binary to UUID from LDAP

2023-03-28 Thread Kagamin via Digitalmars-d-learn
This guid is (int,short,short,byte[8]) in little endian byte order. So if you want to convert it to big endian, you'll need to swap bytes in those int and two shorts. ``` ubyte[] guid=... int* g1=cast(int*)guid.ptr; *g1=bswap(*g1); ```

Re: Log rotation in std.logger.filelogger

2023-05-22 Thread Kagamin via Digitalmars-d-learn
I suppose you write a custom logger for that or take an already written one from code.dlang.org

Re: Compiling to RiscV32

2023-07-10 Thread Kagamin via Digitalmars-d-learn
You try to use C declarations, but they are specific to each C library, and different C libraries have different declarations, so headers can't decide which C library declarations to use. Try -mtriple=riscv32-unknown-linux

Re: Compiling to RiscV32

2023-07-10 Thread Kagamin via Digitalmars-d-learn
Worked for me on ldc 1.20 https://forum.dlang.org/post/vuxuftogvszztdrrt...@forum.dlang.org

Re: Compiling to RiscV32

2023-07-11 Thread Kagamin via Digitalmars-d-learn
Probably bug in druntime, v-functions shouldn't have `pragma(printf)`, because they don't have arguments to check.

Re: Compiling to RiscV32

2023-07-12 Thread Kagamin via Digitalmars-d-learn
Maybe the problem is with va_list, try to compile with -mtriple=riscv64-unknown-linux -mcpu=generic-rv64

Re: Print debug data

2023-07-18 Thread Kagamin via Digitalmars-d-learn
Naming is hard.

Re: AA vs __gshared

2023-07-27 Thread Kagamin via Digitalmars-d-learn
On Friday, 28 July 2023 at 03:54:53 UTC, IchorDev wrote: I was told that using `__gshared` is quite a bit faster at runtime than using `shared`, but I also don't really know anything concrete about `shared` because the spec is so incredibly vague about it. The difference between them is purel

Re: array index out of bound may not throw exception?

2023-07-27 Thread Kagamin via Digitalmars-d-learn
On Friday, 21 July 2023 at 23:40:44 UTC, mw wrote: Is there a way to let it report on the spot when it happens? On linux if you catch an exception and call abort, the debugger will show you where abort was called, on windows you can call DebugBreak function, the debugger will show where it wa

Re: Is it possible to make an Linux Executable Binary using a Windows Operating System? [compiling and linking]

2023-07-27 Thread Kagamin via Digitalmars-d-learn
You will also need crt1.o, crti.o, crtn.o and libc.a

Re: AA vs __gshared

2023-07-28 Thread Kagamin via Digitalmars-d-learn
Your error is using allocating the object with malloc. Since gc doesn't see your AA, the AA is freed and you get UAF.

Re: malloc error when trying to assign the returned pointer to a struct field

2023-09-08 Thread Kagamin via Digitalmars-d-learn
On Friday, 8 September 2023 at 13:32:00 UTC, rempas wrote: On Friday, 8 September 2023 at 13:05:47 UTC, evilrat wrote: ```d import core.stdc.stdlib; import core.stdc.stdio; alias u64 = ulong; alias i64 = long; struct Vec(T) { private: T* _ptr = null; // The pointer to the data u64 _cap = 0

Re: DMD: How to compile executable without producing .obj file?

2023-11-09 Thread Kagamin via Digitalmars-d-learn
The .exe is produced by the linker, which works with files: it takes one or more .obj files with program code and links them into and .exe file. I heard ldc has builtin linker or something like that, so hypothetically might be able to link on the fly.

Re: ImportC: Windows.h

2023-11-30 Thread Kagamin via Digitalmars-d-learn
You can declare them ``` extern(C) void _InterlockedExchangeAdd(){ assert(false); } ```

Re: ImportC: Windows.h

2023-12-01 Thread Kagamin via Digitalmars-d-learn
Is GENERIC_WRITE awailable?

Re: Behaves different on my osx and linux machines

2023-12-22 Thread Kagamin via Digitalmars-d-learn
Add more debugging? ``` bool done = false; while (!done) { writeln(1); auto result = ["echo", "Hello World"].execute; if (result.status != 0) { writeln(2); throw new Exception("echo failed"); } writeln(result

Re: Behaves different on my osx and linux machines

2023-12-27 Thread Kagamin via Digitalmars-d-learn
Maybe write and read lock each other, try to use puts: ``` bool done = false; while (!done) { puts("1"); auto result = ["echo", "Hello World"].execute; if (result.status != 0) { writeln(2); throw new Exception("echo fa

Re: Behaves different on my osx and linux machines

2023-12-27 Thread Kagamin via Digitalmars-d-learn
Maybe you're not supposed to print text while reading?

Re: Error "Outer Function Context is Needed" when class declared in unittest

2024-01-25 Thread Kagamin via Digitalmars-d-learn
Looks like the context is currently passed for nested functions, not for nested classes.

Re: Accessing array elements with a pointer-to-array

2024-01-25 Thread Kagamin via Digitalmars-d-learn
On Thursday, 25 January 2024 at 20:11:05 UTC, Stephen Tashiro wrote: void main() { ulong [3][2] static_array = [ [0,1,2],[3,4,5] ]; static_array[2][1] = 6; } The static array has length 2, so index 2 is out of bounds, must be 0 or 1.

Re: length's type.

2024-01-29 Thread Kagamin via Digitalmars-d-learn
I have an idea to estimate how long strlen takes on an exabyte string.

New discussion

2024-02-05 Thread Kagamin via Digitalmars-d-learn
You can just post with a new title.

Re: what was the problem with the old post blit operator already ?

2024-02-15 Thread Kagamin via Digitalmars-d-learn
It was mostly fine, such types are not supposed to be immutable, but recently came an idea of reference counted strings, which need to be immutable for being strings.

Re: length's type.

2024-02-16 Thread Kagamin via Digitalmars-d-learn
On Thursday, 8 February 2024 at 05:56:57 UTC, Kevin Bailey wrote: How many times does the following loop print? I ran into this twice doing the AoC exercises. It would be nice if it Just Worked. ``` import std.stdio; int main() { char[] something = ['a', 'b', 'c']; for (auto i = -1; i < s

Re: length's type.

2024-02-16 Thread Kagamin via Digitalmars-d-learn
On Tuesday, 13 February 2024 at 23:57:12 UTC, Ivan Kazmenko wrote: I do use lengths in arithmetic sometimes, and that leads to silent bugs currently. On the other hand, since going from 16 bits to 32 and then 64, in my user-side programs, I had a flat zero bugs because some length was 2^{31} o

Re: vibe.d still does not work on FreeBSD.

2024-02-18 Thread Kagamin via Digitalmars-d-learn
Docs say SSL_get0_peer_certificate was added in openssl 3.

Re: "Error: `TypeInfo` cannot be used with -betterC" on a CTFE function

2024-04-09 Thread Kagamin via Digitalmars-d-learn
On Sunday, 7 April 2024 at 06:46:39 UTC, Liam McGillivray wrote: instantiated from here: `front!char` Looks like autodecoding, try to comment `canFind`.

Re: OT: in economic terms Moore's Law is already dead

2019-07-20 Thread Kagamin via Digitalmars-d-learn
TBH modern computers are obscenely powerful, I just spent weeks on celeron 1.8GHz 2mb L2 cache 2gb ram computer and didn't see any slowness on it despite some bloated software in python and a strange text editor pluma that ate 150mb ram just editing a plain text file, I swear it's not based on

Re: Wrong vtable for COM interfaces that don't inherit IUnknown

2019-07-20 Thread Kagamin via Digitalmars-d-learn
On Tuesday, 16 July 2019 at 01:38:49 UTC, evilrat wrote: Also from what I see MS done this intentionally, means they either no longer loves COM or there was some other good reason. Primary consumer of COM interfaces is Visual Basic. It was really only Bill Gates who loved Basic, he wrote a Bas

Re: Wrong vtable for COM interfaces that don't inherit IUnknown

2019-07-21 Thread Kagamin via Digitalmars-d-learn
On Sunday, 21 July 2019 at 07:04:00 UTC, rikki cattermole wrote: COM is used heavily in WinAPI since about Vista. Pretty much all new functionality has been exposed by it and NOT extern(Windows) functions which was the standard during up to about XP (for example notification icons would today b

Re: Is betterC affect to compile time?

2019-07-26 Thread Kagamin via Digitalmars-d-learn
On Thursday, 25 July 2019 at 12:46:48 UTC, Oleg B wrote: What reason for such restrictions? It's fundamental idea or temporary implementation? I think it's a dmd limitation. Currently it has a bug that it can still generate code for ctfe templated functions, and they will fail to link if they

Re: Calling / running / executing .d script from another .d script

2019-07-29 Thread Kagamin via Digitalmars-d-learn
On Sunday, 28 July 2019 at 12:56:12 UTC, BoQsc wrote: Right now, I'm thinking what is correct way to run another .d script from a .d script. Do you have any suggestions? You mean something like execute(["rdmd", "another.d"]); ?

Re: Help me decide D or C

2019-08-01 Thread Kagamin via Digitalmars-d-learn
On Wednesday, 31 July 2019 at 22:30:52 UTC, Alexandre wrote: 1) Improve as a programmer 2) Have fun doing programs Thats it basically. I am planning to study all "free" time I have. I am doing basically this since last year. Try Basic. It has builtin graphics, seeing you program draw is quit

Re: Is it possible to target all platforms that Qt Quick can target?

2019-08-12 Thread Kagamin via Digitalmars-d-learn
You're probably interested in readiness, not possibility?

Re: Pro programmer

2019-08-26 Thread Kagamin via Digitalmars-d-learn
On Monday, 26 August 2019 at 12:02:12 UTC, GreatSam4sure wrote: I want customizable GUI toolkit like JavaFX and adobe spark framework in D. DWT was translated from java SWT, you can do the same for JavaFX, D is heavily based on java and there's an automatic translation tool from java to D.

Re: D1: How to declare an Associative array with data

2019-09-05 Thread Kagamin via Digitalmars-d-learn
Maybe something like this https://forum.dlang.org/post/hloitwqnisvtgfoug...@forum.dlang.org

Re: getting rid of immutable (or const)

2019-09-06 Thread Kagamin via Digitalmars-d-learn
On Thursday, 5 September 2019 at 12:46:06 UTC, berni wrote: OK. This are two solutions and although I'll probably not going to use any of those (due to other reasons), I still don't understand, why the original approach does not work. If I've got a book an put it in a box and later I'll get it

Re: Name change weird

2019-09-13 Thread Kagamin via Digitalmars-d-learn
Maybe you upgraded SFML and now binding doesn't match?

Re: How to use Dbus to detect application uniqueness in D?

2019-09-28 Thread Kagamin via Digitalmars-d-learn
https://ddbus.dpldocs.info/ddbus.bus.requestName.html

Re: How to use Dbus to detect application uniqueness in D?

2019-09-30 Thread Kagamin via Digitalmars-d-learn
On Sunday, 29 September 2019 at 02:09:56 UTC, Hossain Adnan wrote: On Saturday, 28 September 2019 at 13:37:12 UTC, Kagamin wrote: https://ddbus.dpldocs.info/ddbus.bus.requestName.html It requires a Connection type which I cannot find in the API. It's in ddbus.thin, missing documentation comm

Re: How to use Dbus to detect application uniqueness in D?

2019-09-30 Thread Kagamin via Digitalmars-d-learn
On Sunday, 29 September 2019 at 02:09:56 UTC, Hossain Adnan wrote: On Saturday, 28 September 2019 at 13:37:12 UTC, Kagamin wrote: https://ddbus.dpldocs.info/ddbus.bus.requestName.html It requires a Connection type which I cannot find in the API. It's in ddbus.thin, missing documentation comm

Re: Eliding of slice range checking

2019-10-29 Thread Kagamin via Digitalmars-d-learn
On Wednesday, 23 October 2019 at 11:20:59 UTC, Per Nordlöw wrote: Does DMD/LDC avoid range-checking in slice-expressions such as the one in my array-overload of `startsWith` defined as bool startsWith(T)(scope const(T)[] haystack, scope const(T)[] needle) { if (haystack.l

Re: Eliding of slice range checking

2019-10-31 Thread Kagamin via Digitalmars-d-learn
On Wednesday, 23 October 2019 at 11:20:59 UTC, Per Nordlöw wrote: Does DMD/LDC avoid range-checking in slice-expressions such as the one in my array-overload of `startsWith` defined as bool startsWith(T)(scope const(T)[] haystack, scope const(T)[] needle) { if (haystack.l

Re: Why same pointer type for GC and manual memory?

2019-11-14 Thread Kagamin via Digitalmars-d-learn
On Wednesday, 13 November 2019 at 16:43:27 UTC, IGotD- wrote: On Wednesday, 13 November 2019 at 15:30:33 UTC, Dukc wrote: I'm not 100% sure what managed pointers mean -Are they so that you can't pass them to unregistered memory? A library solution would likely do -wrap the pointer in a struct

Re: Parsing with dxml

2019-11-19 Thread Kagamin via Digitalmars-d-learn
On Monday, 18 November 2019 at 06:44:43 UTC, Joel wrote: ``` http://www.w3.org/2001/XMLSchema-instance";> ``` You're missing a closing tag.

Re: OR in version conditional compilation

2020-03-18 Thread Kagamin via Digitalmars-d-learn
https://issues.dlang.org/show_bug.cgi?id=19495#c1

Re: Best way to learn 2d games with D?

2020-03-19 Thread Kagamin via Digitalmars-d-learn
On Thursday, 19 March 2020 at 13:10:29 UTC, Steven Schveighoffer wrote: Similar for me but not GameMaker but RPG Maker. I've seen all your work on the language, and this is a pretty good endorsement. Not sure if I'm ready to pay for it though, I want to make sure his motivation/drive is not

Re: Can I get the compiler to warn or fail on uninitialized variables/class members?

2020-03-21 Thread Kagamin via Digitalmars-d-learn
Maybe if you teach dparse to do this check.

Re: GtkD - how to list 0..100K strings [solved]

2020-04-28 Thread Kagamin via Digitalmars-d-learn
On Monday, 27 April 2020 at 10:28:04 UTC, mark wrote: I renamed the class shown in my previous post from View to InnerView, then created a new View class: class View : ScrolledWindow { import qtrac.debfind.modelutil: NameAndDescription; InnerView innerView; this() { super(

Re: Spawn a Command Line application Window and output log information

2020-05-18 Thread Kagamin via Digitalmars-d-learn
On Monday, 18 May 2020 at 17:02:02 UTC, BoQsc wrote: The important question is: how can we change the name/title of this Command Line application. As the simplest solution, you can set the window title in shortcut properties.

Re: Spawn a Command Line application Window and output log information

2020-05-18 Thread Kagamin via Digitalmars-d-learn
On Monday, 18 May 2020 at 17:20:17 UTC, BoQsc wrote: It would be great if we could change/customise the icon of the Command line application that run the HelloWorld application. But I have a bad feeling that it is probably not possible without a GUI library. I think the window icon is just th

Re: How to allocate/free memory under @nogc

2020-05-22 Thread Kagamin via Digitalmars-d-learn
On Thursday, 21 May 2020 at 17:19:10 UTC, Konstantin wrote: Hi all! I will try to ask again(previous two posts still have no answers) : are there any site/page/docs somewhere to track actual info about @nogc support in language itself and in phobos library? Or, at least plans to extend such sup

Re: DIP1000 spec?

2020-06-14 Thread Kagamin via Digitalmars-d-learn
Logic is apparently still in flux, too early to document.

Re: Initializing an associative array of struct

2020-06-14 Thread Kagamin via Digitalmars-d-learn
that's int id=parameters[param].id;

Re: Initializing an associative array of struct

2020-06-14 Thread Kagamin via Digitalmars-d-learn
string param="aa"; parameters[param]=Parameter(); in id=parameters[param].id;

Re: GtkD code review - How to update a progressbar using data sharing concurrency

2020-06-21 Thread Kagamin via Digitalmars-d-learn
Not sure how much synchronization do you want to do. import gio.Application : GioApplication = Application; import gtk.Application : Application; import gtk.ApplicationWindow : ApplicationWindow; import gtk.ProgressBar : ProgressBar; import glib.Timeout : Timeout; import gtkc.gtktypes : GApplicat

Re: How to correctly integrate D library to Swift/Obj-C mobile project?

2020-06-22 Thread Kagamin via Digitalmars-d-learn
If you want to use them from D, you need those classes and methods declared in the D language, in text.

Re: Downloading files over TLS

2020-06-26 Thread Kagamin via Digitalmars-d-learn
On Friday, 26 June 2020 at 10:12:09 UTC, Jacob Carlborg wrote: Downloading files over TLS. This seems that it's something that should be quite simple to do. My high level goals are cross-platform and easy distribution. I don't need anything fancy just a simple API like this: download("https:/

Re: How to send ownerTid into a parallel foreach loop?

2020-06-27 Thread Kagamin via Digitalmars-d-learn
std.concurrency is for noninteractive appications, the approach with gui timer was the correct one.

Re: How to send ownerTid into a parallel foreach loop?

2020-06-27 Thread Kagamin via Digitalmars-d-learn
On Saturday, 27 June 2020 at 07:51:21 UTC, adnan338 wrote: On Saturday, 27 June 2020 at 07:31:56 UTC, Kagamin wrote: std.concurrency is for noninteractive appications, the approach with gui timer was the correct one. Thank you. That works but my progress bar is sometimes getting stuck because

Re: Light-weight runtime

2020-06-29 Thread Kagamin via Digitalmars-d-learn
On Sunday, 28 June 2020 at 07:09:53 UTC, Виталий Фадеев wrote: I want light-weight runtime ! How to ? Runtime provides language features that rely on extra code. Removing that code from runtime means to give up on corresponding language features. This way you can implement only features you

Re: Garbage collection

2020-06-29 Thread Kagamin via Digitalmars-d-learn
On Saturday, 27 June 2020 at 14:49:34 UTC, James Gray wrote: I have produced something which essentially reproduces my problem. What is the problem? Do you have a leak or you want to know how GC works?

Re: Calling C functions

2020-06-30 Thread Kagamin via Digitalmars-d-learn
On Monday, 29 June 2020 at 19:55:59 UTC, Steven Schveighoffer wrote: Yep, for sure. I'll file an issue. Anyone know why the calling convention would differ? It's easier to enforce left to right evaluation order this way: arguments are pushed to stack as they are evaluated, which is pascal cal

Re: Program exited with code -11 when calling

2020-06-30 Thread Kagamin via Digitalmars-d-learn
bson_t* bson_new_from_json(in char* data, long len, bson_error_t* error); string str_utf8 = "{\"a\":1}"; bson_error_t error; auto bson = bson_new_from_json(str_utf8.ptr, str_utf8.length, &error); You have a wrong declaration for bson_error_t too.

  1   2   3   4   5   6   7   8   9   10   >