Re: Efficient sort function allowing own test and swap function as parameter

2020-10-07 Thread Imperatorn via Digitalmars-d-learn
On Wednesday, 7 October 2020 at 00:08:06 UTC, Ali Çehreli wrote: On 10/6/20 3:18 PM, Alaindevos wrote: [...] I had fun writing the following program. Note how makeIndex allows visiting elements in sorted order without actually sorting them. [...] Nice use of iota!

Re: Trying to create a trivial 64 bit D Lang DLL on a Windows 10 machine and cant get past linking.

2020-10-02 Thread Imperatorn via Digitalmars-d-learn
On Friday, 2 October 2020 at 08:07:33 UTC, Ferhat Kurtulmuş wrote: On Friday, 2 October 2020 at 07:34:03 UTC, WhatMeWorry wrote: On Thursday, 1 October 2020 at 21:56:46 UTC, Ferhat Kurtulmuş wrote: On Thursday, 1 October 2020 at 21:35:42 UTC, WhatMeWorry wrote: [...] 1) try running your

Re: Is there a way to force emitting of stack frame for a specific function?

2020-10-08 Thread Imperatorn via Digitalmars-d-learn
On Thursday, 8 October 2020 at 08:48:45 UTC, Andrey Zherikov wrote: I'm trying to implement some mix of native and custom stack trace dump for exception logging: I want to print custom text instead of some stack frames. To clarify more: I have a function that I want to substitute with other

Re: winapi, dll

2020-10-15 Thread Imperatorn via Digitalmars-d-learn
On Thursday, 15 October 2020 at 12:45:42 UTC, Atmosfear wrote: I didn't find how to call the queryperformancecounter function. I tried this. Returns errors, doesn't know what BOOL and LARGE_INTEGER are. import core.sys.windows.windows; import core.sys.windows.w32api; import

Re: winapi, dll

2020-10-15 Thread Imperatorn via Digitalmars-d-learn
On Thursday, 15 October 2020 at 20:13:37 UTC, Atmosfear wrote: On Thursday, 15 October 2020 at 16:32:06 UTC, Imperatorn wrote: On Thursday, 15 October 2020 at 12:45:42 UTC, Atmosfear wrote: I didn't find how to call the queryperformancecounter function. I tried this. Returns errors, doesn't

Re: It is possible to substract 5 from 3 unsigned integer

2020-10-06 Thread Imperatorn via Digitalmars-d-learn
On Tuesday, 6 October 2020 at 12:24:56 UTC, Alaindevos wrote: Is that the expected behavior of the programmer? Opinions can differ. Feel free to elaborate. Elaborate please. Are you really asking if one can do subtraction in D.

Re: cannot call impure function

2020-10-04 Thread Imperatorn via Digitalmars-d-learn
On Sunday, 4 October 2020 at 16:48:24 UTC, Michael wrote: Dear all, Sorry for the potentially stupid question, but I'm a complete newbie to D. Why does compiling the following trivial code fail? [...] I have tried my best to make it fail, but can't. Maybe it's something with the

Learn D while updating Rosetta code

2020-10-04 Thread Imperatorn via Digitalmars-d-learn
Just a tip to everyone. If you're trying to learn D, you can try to implement some of these missing tasks and update the corresponding page: http://rosettacode.org/wiki/Reports:Tasks_not_implemented_in_D

Re: question on dub and postgresql

2020-10-05 Thread Imperatorn via Digitalmars-d-learn
On Monday, 5 October 2020 at 08:24:26 UTC, Alaindevos wrote: Can I say python has pip, ruby has bundle and D has dub. Meaning they perform the same function ? Or am I wrong? As I use unix the parameters for include and library are a real pain. I have totally no idea how to connect to a

Re: Range format specifiers in other languages?

2020-10-11 Thread Imperatorn via Digitalmars-d-learn
On Sunday, 11 October 2020 at 23:57:31 UTC, Ali Çehreli wrote: I find D's %( and %) range format specifiers very useful: import std.stdio; import std.range; void main() { 5.iota.writefln!"%(%s, %)"; // Prints 0, 1, 2, 3, 4 } Are there similar features in other languages? Thank you, Ali

Re: Range format specifiers in other languages?

2020-10-11 Thread Imperatorn via Digitalmars-d-learn
On Monday, 12 October 2020 at 00:59:33 UTC, Adam D. Ruppe wrote: On Monday, 12 October 2020 at 00:46:37 UTC, Imperatorn wrote: To people trying to learn, why is that % before ( needed in the format string? The %( ... %) stuff is expanded and repeated for each element inside the given array.

universal alpha?

2020-10-16 Thread Imperatorn via Digitalmars-d-learn
https://forum.dlang.org/post/e5ghnv$2bns$1...@digitaldaemon.com On Tuesday, 30 May 2006 at 04:29:51 UTC, BCS wrote: Does anyone have a link to a definition of universal alpha as used in the DMD docs? (see: http://www.digitalmars.com/d/lex.html#identifier) For any other lonely souls looking

Re: Forward referencing functions in D

2020-10-16 Thread Imperatorn via Digitalmars-d-learn
On Friday, 16 October 2020 at 19:55:53 UTC, wilcro wrote: The web page "Programming in D for C Programmers" (https://dlang.org/articles/ctod.html#forwardfunc) states that forward declarations are neither required nor permitted, and that the following construct is allowable: void myfunc() {

Re: List of exceptions?

2020-10-10 Thread Imperatorn via Digitalmars-d-learn
On Saturday, 10 October 2020 at 12:12:35 UTC, DMon wrote: Is there a list of a list of the exceptions or what can be used with catch? I'm thinking that I missed it and there is something easier than breaking old code, scouring the site, or hypnotic regression. To clarify, do you want a

Re: vibe.d / experience / feedback

2020-10-10 Thread Imperatorn via Digitalmars-d-learn
On Thursday, 1 October 2020 at 06:32:23 UTC, Robert M. Münch wrote: Hi, we are currently using vibe.d for a prototype and I want to post some experiences. I know one shouldn't only address the problems but provide some solutions. [...] Have you tried Diamond?

Re: List of exceptions?

2020-10-10 Thread Imperatorn via Digitalmars-d-learn
On Saturday, 10 October 2020 at 20:32:22 UTC, DMon wrote: On Saturday, 10 October 2020 at 19:55:44 UTC, Ali Çehreli wrote: On 10/10/20 12:51 PM, DMon wrote: Thank you for your and Imperatorns time. Even if it did go in circles and get stuck in the mud. No problem. We're doing it out of

Re: question on dub and postgresql

2020-10-05 Thread Imperatorn via Digitalmars-d-learn
On Monday, 5 October 2020 at 08:47:45 UTC, Alaindevos wrote: On Monday, 5 October 2020 at 08:34:37 UTC, Imperatorn wrote: On Monday, 5 October 2020 at 08:24:26 UTC, Alaindevos wrote: [...] Take a look at: https://code.dlang.org/packages/dpq2 https://code.dlang.org/packages/ddbc Say I want

Re: It is possible to substract 5 from 3 unsigned integer

2020-10-08 Thread Imperatorn via Digitalmars-d-learn
On Tuesday, 6 October 2020 at 18:24:14 UTC, Alaindevos wrote: There are two subtractions possible. A machine-one which can be architecture dependent, does not have the same results on all computers, and behaves like a modulus in mathematics. A logical one. For the last one higher classes

Re: question on dub and postgresql

2020-10-05 Thread Imperatorn via Digitalmars-d-learn
On Monday, 5 October 2020 at 13:30:22 UTC, Alaindevos wrote: On Monday, 5 October 2020 at 11:35:43 UTC, Imperatorn wrote: On Monday, 5 October 2020 at 08:47:45 UTC, Alaindevos wrote: [...] No, you just dub add dpq2 With dub.json: "dependencies": { "dpq2": "~>1.0.17"

Re: Error on dub build - Trying Vibe-d for the first time

2020-10-14 Thread Imperatorn via Digitalmars-d-learn
On Wednesday, 14 October 2020 at 15:27:46 UTC, Andre Pany wrote: On Wednesday, 14 October 2020 at 13:20:53 UTC, Bruno Rodrigues wrote: On Wednesday, 14 October 2020 at 01:32:34 UTC, Steven Schveighoffer wrote: [...] Thank you, Steve! It did work but none of the examples on the Vibe.d page

Re: I need "windowsx.d" Someone can send It to me?

2020-09-27 Thread Imperatorn via Digitalmars-d-learn
On Friday, 25 September 2020 at 15:03:56 UTC, Marcone wrote: I need windowsx.d but for I don't know the reason is not in dmd. Someone that have it can send to me? I don't know convert windowsx.h to windowsx.d I converting it using VisualD: https://pastebin.com/jzwKRnKZ Try it, maybe it works

Re: Safe to remove AA elements while iterating over it via .byKeyValue?

2020-09-28 Thread Imperatorn via Digitalmars-d-learn
On Sunday, 27 September 2020 at 20:43:19 UTC, Per Nordlöw wrote: On Sunday, 27 September 2020 at 14:23:11 UTC, H. S. Teoh wrote: [...] I believe it's high time we start thinking about detecting these violations at compile-time. I recall it's in the spec somewhere so we should start a

Re: Timeout around function call

2020-09-23 Thread Imperatorn via Digitalmars-d-learn
On Wednesday, 23 September 2020 at 20:54:51 UTC, Imperatorn wrote: On Wednesday, 23 September 2020 at 20:44:51 UTC, Ali Çehreli wrote: On 9/23/20 1:19 PM, Imperatorn wrote: > [...] send a > [...] with timeout. [...] Sorry, I can't see the problem. Could you be more specific about what you

Re: Timeout around function call

2020-09-23 Thread Imperatorn via Digitalmars-d-learn
On Wednesday, 23 September 2020 at 20:44:51 UTC, Ali Çehreli wrote: On 9/23/20 1:19 PM, Imperatorn wrote: > [...] send a > [...] with timeout. [...] Sorry, I can't see the problem. Could you be more specific about what you want to achieve?

Re: Timeout around function call

2020-09-23 Thread Imperatorn via Digitalmars-d-learn
On Wednesday, 23 September 2020 at 17:33:50 UTC, drathier wrote: On Tuesday, 22 September 2020 at 21:55:51 UTC, Imperatorn wrote: [...] Blocking is perfectly fine. I'm wondering if I need things to be shared now or something? Not used to programming with threads. Adding a shared modifier

Re: Compile and run in Win10-VSCode

2020-09-25 Thread Imperatorn via Digitalmars-d-learn
On Friday, 25 September 2020 at 13:38:56 UTC, Paul wrote: Hi Community, I'm Win10: I have VSCode installed. I have DMD installed and can compile examples from a Win CMD console. 1) How do I compile and run from within VSCode? 2) VSCode Extensions: Do I need them? One kept

Re: A scheduled control signal with fibers?

2020-09-25 Thread Imperatorn via Digitalmars-d-learn
On Friday, 25 September 2020 at 11:58:53 UTC, Ferhat Kurtulmuş wrote: Hi, I have a problem to solve that may be solved using fibers. I have no previous experience with fibers. We are working on a variable-rate weeder. A camera is installed in front of a tractor. A flame weeder is connected

Re: I need "windowsx.d" Someone can send It to me?

2020-09-27 Thread Imperatorn via Digitalmars-d-learn
On Friday, 25 September 2020 at 15:03:56 UTC, Marcone wrote: I need windowsx.d but for I don't know the reason is not in dmd. Someone that have it can send to me? I don't know convert windowsx.h to windowsx.d https://wiki.dlang.org/Bindings#Binding_generators

Re: I need "windowsx.d" Someone can send It to me?

2020-09-27 Thread Imperatorn via Digitalmars-d-learn
On Friday, 25 September 2020 at 15:03:56 UTC, Marcone wrote: I need windowsx.d but for I don't know the reason is not in dmd. Someone that have it can send to me? I don't know convert windowsx.h to windowsx.d You don't want to just include it?

Re: Timeout around function call

2020-09-22 Thread Imperatorn via Digitalmars-d-learn
On Tuesday, 22 September 2020 at 09:32:13 UTC, drathier wrote: What's the obvious way to put a timeout around a function call? I'm thinking a 5 or 30 second timeout, and I'm expecting it to pretty much never time out. You have several options. Either you use the actor model (spawn[Linked])

Specify dmd or ldc compiler and version in a json dub file?

2020-09-17 Thread Imperatorn via Digitalmars-d-learn
https://forum.dlang.org/post/nnxbwdypwepymgerz...@forum.dlang.org On Tuesday, 8 August 2017 at 09:17:02 UTC, data pulverizer wrote: Hi, I would like to know how to specify dmd or ldc compiler and version in a json dub file. Thanks in advance. https://dub.pm/settings.html

Good repos to learn D

2020-09-19 Thread Imperatorn via Digitalmars-d-learn
What are some good examples of pretty large/medium size, good structured repos in D? I'm looking for examples to learn from Thanks!

Re: Good repos to learn D

2020-09-19 Thread Imperatorn via Digitalmars-d-learn
On Saturday, 19 September 2020 at 13:13:58 UTC, Jacob Carlborg wrote: On Saturday, 19 September 2020 at 08:26:36 UTC, Imperatorn wrote: [...] Here are some examples of large projects: [...] Thanks, I'll check them out! /Forsberg

Re: Vibe.d

2020-09-19 Thread Imperatorn via Digitalmars-d-learn
On Saturday, 19 September 2020 at 13:13:56 UTC, Jack wrote: Hi, I am building a webapp using vibe.d which is working well on macOS and Linux. However, when I run it on windows I get: Program exited with code -1073741701 I created a new default project with: dub init test -t vibe.d and get

Re: Building LDC runtime for a microcontroller

2020-09-19 Thread Imperatorn via Digitalmars-d-learn
On Monday, 7 September 2020 at 22:13:20 UTC, Adam D. Ruppe wrote: On Monday, 7 September 2020 at 20:55:54 UTC, IGotD- wrote: [...] Well, -betterC existed even then, but it was *completely* useless. It didn't become useful until 2016 or 2017. [...] Cool!

Re: A scheduled control signal with fibers?

2020-09-27 Thread Imperatorn via Digitalmars-d-learn
On Sunday, 27 September 2020 at 10:52:58 UTC, Ferhat Kurtulmuş wrote: On Sunday, 27 September 2020 at 10:40:25 UTC, Ali Çehreli wrote: [...] [...] I remember that your book covers passing messages with send(). Probably I will rewrite it using that mechanism, you are right, I noticed that

Re: Safe to remove AA elements while iterating over it via .byKeyValue?

2020-09-27 Thread Imperatorn via Digitalmars-d-learn
On Sunday, 27 September 2020 at 13:02:04 UTC, Per Nordlöw wrote: Is it safe to remove AA-elements from an `aa` I'm iterating over via aa.byKeyValue? I'm currently doing this: foreach (ref kv; aa.byKeyValue) { if (pred(kv.key)) aa.remove(kv.key); // ok? } if

Re: Safe to remove AA elements while iterating over it via .byKeyValue?

2020-09-27 Thread Imperatorn via Digitalmars-d-learn
On Sunday, 27 September 2020 at 13:02:04 UTC, Per Nordlöw wrote: Is it safe to remove AA-elements from an `aa` I'm iterating over via aa.byKeyValue? I'm currently doing this: foreach (ref kv; aa.byKeyValue) { if (pred(kv.key)) aa.remove(kv.key); // ok? } if

Re: std.net.curl get json_encode

2020-10-02 Thread Imperatorn via Digitalmars-d-learn
On Friday, 2 October 2020 at 21:12:09 UTC, Vino wrote: Hi All, Request your help, the below code is working but we need the output as a json array, in PHP we have json_encode(content), so how to do the same in D, the output is as below, as we need to store this output into database table

Re: std.net.curl get json_encode

2020-10-02 Thread Imperatorn via Digitalmars-d-learn
On Friday, 2 October 2020 at 21:12:09 UTC, Vino wrote: Hi All, Request your help, the below code is working but we need the output as a json array, in PHP we have json_encode(content), so how to do the same in D, the output is as below, as we need to store this output into database table

Re: Good repos to learn D

2020-09-20 Thread Imperatorn via Digitalmars-d-learn
On Sunday, 20 September 2020 at 04:27:59 UTC, H. S. Teoh wrote: On Sat, Sep 19, 2020 at 08:26:36AM +, Imperatorn via Digitalmars-d-learn wrote: What are some good examples of pretty large/medium size, good structured repos in D? I'm looking for examples to learn from [...] Phobos itself

Re: C++ code to D (multi dem 3d mesh)

2020-10-27 Thread Imperatorn via Digitalmars-d-learn
On Monday, 26 October 2020 at 23:38:22 UTC, Joel wrote: ``` struct vec3d { float x, y, z; } [...] It's not really clear what your question is.

Re: C++ code to D (multi dem 3d mesh)

2020-10-27 Thread Imperatorn via Digitalmars-d-learn
On Tuesday, 27 October 2020 at 07:32:30 UTC, Joel wrote: On Tuesday, 27 October 2020 at 07:17:46 UTC, Imperatorn wrote: On Monday, 26 October 2020 at 23:38:22 UTC, Joel wrote: ``` struct vec3d { float x, y, z; } [...] It's not really clear what your question is. I'm trying to

Re: Foreach output into a multi dimensional associative array.

2020-10-27 Thread Imperatorn via Digitalmars-d-learn
On Monday, 26 October 2020 at 19:05:04 UTC, Vino wrote: Hi All, Request your help on the below on how to store the output to a multi dimensional associative array. Code: import std.stdio: writeln; import asdf: parseJson; import std.conv: to; void main() { string[int][string] aa; string

Re: How Stop Worker Thread if Owner Thread is Finished?

2020-10-27 Thread Imperatorn via Digitalmars-d-learn
On Tuesday, 27 October 2020 at 00:46:48 UTC, Marcone wrote: Because when the main thread is completed the worker thread continues to run. Please provide a code example. It's much easier to reason about. Are you creating a thread from a thread and want the 2nd spawned thread to be terminated

Re: How is this an "Access Violation"

2020-10-27 Thread Imperatorn via Digitalmars-d-learn
On Tuesday, 27 October 2020 at 02:05:37 UTC, Ruby The Roobster wrote: Following function when called throws an access violation. I think it has to do with the assert statements, but I don't know why. [...] OT, but why do you have a function that immediately replaces what you passed?

Re: GC and sensible data read by File

2020-10-24 Thread Imperatorn via Digitalmars-d-learn
On Sunday, 4 October 2020 at 12:10:39 UTC, frame wrote: Hello, I'm new to D and try to find out a memory leak in my program. I inspected the private bytes with VmMap on Windows to see which data is still kept. [...] The GC doesn't zero it out, so that's expected.

Re: Member variables in method are null when called as delegate from thread

2021-01-12 Thread Imperatorn via Digitalmars-d-learn
On Monday, 11 January 2021 at 17:26:00 UTC, Arafel wrote: void f() { assert(i == 0); // Expected assert(j == 1); // Expected assert(s.i == 0); // Expected assert(s.j == 0); // Wait, what? } At first sight this looks unexpected. But I think if you have a shared variable inside

any chance to get it working on windows xp?

2021-01-12 Thread Imperatorn via Digitalmars-d-learn
https://forum.dlang.org/post/qsgtohsykwldipgng...@forum.dlang.org On Saturday, 3 October 2020 at 23:14:57 UTC, Drone1h wrote: On Monday, 18 May 2020 at 05:36:01 UTC, Mike Parker wrote: [...] This is not exactly a reply to the original thread, but maybe it helps someone who has searched for

Re: How build DCD on Windows?

2021-01-12 Thread Imperatorn via Digitalmars-d-learn
On Tuesday, 12 January 2021 at 06:25:09 UTC, evilrat wrote: On Tuesday, 12 January 2021 at 00:35:41 UTC, Marcone wrote: Hi, Someone can Help me build exe dcd server and client on WIndows? Step by step? Becouse the informations disponible is very hard to undestand. Are you serious? It's on

Re: Linux shared library loading/linking from C does not invoke (shared) static this

2021-01-12 Thread Imperatorn via Digitalmars-d-learn
On Tuesday, 12 January 2021 at 08:19:45 UTC, ichneumwn wrote: Where could one file a suggestion for an update to the documentation? In the top right section of the page you can click the "Improve this page"-link.

Re: any chance to get it working on windows xp?

2021-01-12 Thread Imperatorn via Digitalmars-d-learn
On Tuesday, 12 January 2021 at 12:40:28 UTC, Mike Parker wrote: On Tuesday, 12 January 2021 at 10:25:42 UTC, Imperatorn wrote: https://forum.dlang.org/post/qsgtohsykwldipgng...@forum.dlang.org On Saturday, 3 October 2020 at 23:14:57 UTC, Drone1h wrote: On Monday, 18 May 2020 at 05:36:01 UTC,

Re: C++ or D?

2020-12-29 Thread Imperatorn via Digitalmars-d-learn
On Tuesday, 10 November 2020 at 01:00:50 UTC, Mark wrote: Hi all, my question would be about using D or not using D. Is the newest C++ iteration any good compared to D? [...] https://ibb.co/syQRs9v

Re: My first application in Dlang

2020-12-04 Thread Imperatorn via Digitalmars-d-learn
On Thursday, 3 December 2020 at 03:54:16 UTC, Marcone wrote: On Thursday, 3 December 2020 at 02:44:40 UTC, Ali Çehreli wrote: On 12/2/20 5:46 PM, Marcone wrote: [...] Cool. :) But did you want to share your *source* code? All I see there is a .exe, which I would not start due to risk of

Re: Anybody know if I can build DMD with Visual Studio 2019?

2020-12-04 Thread Imperatorn via Digitalmars-d-learn
On Wednesday, 2 December 2020 at 22:37:06 UTC, WhatMeWorry wrote: On Tuesday, 1 December 2020 at 22:58:53 UTC, WhatMeWorry wrote: I'm trying to build DMD with Visual D under Visual Studio as shown in the Wiki: https://wiki.dlang.org/Building_under_Windows The notes say to use the solution

Re: name enum vs static named enum

2020-11-07 Thread Imperatorn via Digitalmars-d-learn
On Saturday, 7 November 2020 at 22:12:12 UTC, Arjan wrote: What is the usage of `static` in this? : ``` static enum Status { NONE, BUSY, ... } ``` It's redundant

Re: New vs length on dymamic array

2020-11-09 Thread Imperatorn via Digitalmars-d-learn
On Monday, 9 November 2020 at 08:06:54 UTC, Andrey wrote: Hello, Are here any differences in creation of dynamic array with known size? auto array = new wchar[](111); and wchar[] array; array.length = 111; You can check using compiler explorer: https://godbolt.org/

Re: Hunt database

2020-11-03 Thread Imperatorn via Digitalmars-d-learn
On Tuesday, 3 November 2020 at 14:05:18 UTC, Vino wrote: Hi All, Currently testing Hunt database, and facing an issue as below, hence request your help [...] What datatype is Seq in your settings table?

Re: Why is vibe.d json serializer/deserializer so complex?

2020-10-31 Thread Imperatorn via Digitalmars-d-learn
On Saturday, 31 October 2020 at 22:42:20 UTC, James Blachly wrote: On 10/30/20 1:56 PM, Steven Schveighoffer wrote: [...] So I've been meaning to ask this as I have been learning Rust off-and-on recently for web development, and was impressed by the traits functionality. In particular, with

Re: Removind duplicates for JSON string

2020-11-01 Thread Imperatorn via Digitalmars-d-learn
On Sunday, 1 November 2020 at 13:31:19 UTC, Anonymouse wrote: On Sunday, 1 November 2020 at 09:14:35 UTC, Vino wrote: [...] I can only test with Phobos (no asdf on run.dlang.io), but isn't just normal sort and uniq what you want? data[] .array .sort .uniq!((tup1, tup2) =>

Re: What is the difference between enum and shared immutable?

2020-10-29 Thread Imperatorn via Digitalmars-d-learn
On Thursday, 29 October 2020 at 16:31:41 UTC, Ali Çehreli wrote: On 10/28/20 5:55 PM, matheus wrote: On Wednesday, 28 October 2020 at 22:07:06 UTC, H. S. Teoh wrote: ... (This is why it's a bad idea to use enum with an array literal, because every time it's referenced you get a new copy of

Re: C++ or D?

2020-12-31 Thread Imperatorn via Digitalmars-d-learn
On Thursday, 31 December 2020 at 07:32:31 UTC, RSY wrote: Sorry for the spam, but this is because of people like him that people like me (i discovered D recently) that can't be aware of why D is a great language They diminish all arguments that makes D better than alternatives You guys

Re: Static constructor

2021-01-06 Thread Imperatorn via Digitalmars-d-learn
On Wednesday, 6 January 2021 at 17:05:02 UTC, ludo wrote: I read in the documentation "Static constructors are used to initialize static class members with values that cannot be computed at compile time" [...] Since this is not the complete code it's a bit hard to know, but I'd guess this

Re: How can I create a Standalone Bundle Portable file application using Dlang?

2021-01-19 Thread Imperatorn via Digitalmars-d-learn
On Tuesday, 19 January 2021 at 11:10:25 UTC, Marcone wrote: On Tuesday, 19 January 2021 at 06:25:31 UTC, Imperatorn wrote: On Monday, 18 January 2021 at 19:42:22 UTC, Marcone wrote: How can I create a Standalone Bundle Portable file application using Dlang? Could you describe what you mean

Re: Issue with socket recieve

2021-01-22 Thread Imperatorn via Digitalmars-d-learn
On Thursday, 21 January 2021 at 03:30:50 UTC, Tim wrote: On Thursday, 21 January 2021 at 03:21:41 UTC, Adam D. Ruppe wrote: On Wednesday, 20 January 2021 at 21:31:54 UTC, Tim wrote: [...] [snip] generate a core.exception.InvalidMemoryOperationError that I can't catch. None of this makes

Re: std.algorithm.splitter on a string not always bidirectional

2021-01-22 Thread Imperatorn via Digitalmars-d-learn
On Friday, 22 January 2021 at 17:29:08 UTC, Steven Schveighoffer wrote: On 1/22/21 11:57 AM, Jon Degenhardt wrote: [...] But that is possible with all 3 splitter variants. Why is one allowed to be bidirectional and the others are not? [...] +1

Re: What are the advantages of using betterC?

2021-01-19 Thread Imperatorn via Digitalmars-d-learn
On Tuesday, 19 January 2021 at 17:44:03 UTC, Rempas wrote: On Tuesday, 19 January 2021 at 17:40:52 UTC, Adam D. Ruppe wrote: betterC is a niche restricted feature set. If you don't already have a use case in mind, I'd recommend avoiding it. It is for cases where you're stuck with certain

Re: Why many programmers don't like GC?

2021-01-13 Thread Imperatorn via Digitalmars-d-learn
On Wednesday, 13 January 2021 at 18:58:56 UTC, Marcone wrote: I've always heard programmers complain about Garbage Collector GC. But I never understood why they complain. What's bad about GC? I would guess because of performance issues.

Re: How can I create a Standalone Bundle Portable file application using Dlang?

2021-01-24 Thread Imperatorn via Digitalmars-d-learn
On Sunday, 24 January 2021 at 11:44:04 UTC, Marcone wrote: On Saturday, 23 January 2021 at 21:26:28 UTC, James Blachly wrote: On 1/20/21 6:50 AM, Marcone wrote: On Tuesday, 19 January 2021 at 14:20:06 UTC, Imperatorn wrote: [...] I do not mean resources .res, except if is possible use files

Re: Why many programmers don't like GC?

2021-01-18 Thread Imperatorn via Digitalmars-d-learn
On Friday, 15 January 2021 at 21:49:07 UTC, H. S. Teoh wrote: On Fri, Jan 15, 2021 at 09:04:13PM +, welkam via Digitalmars-d-learn wrote: [...] As the joke goes, "you can write assembly code in any language". :-D If you code in a sloppy way, it doesn't matter what language you write

Re: Why many programmers don't like GC?

2021-01-18 Thread Imperatorn via Digitalmars-d-learn
On Monday, 18 January 2021 at 12:41:31 UTC, Ola Fosheim Grøstad wrote: On Monday, 18 January 2021 at 12:17:24 UTC, aberba wrote: [...] Not fighting the GC, but the whole argument about improving it, or mix or match, does not work for most developers looking for a new language. So either

Re: How can I create a Standalone Bundle Portable file application using Dlang?

2021-01-18 Thread Imperatorn via Digitalmars-d-learn
On Monday, 18 January 2021 at 19:42:22 UTC, Marcone wrote: How can I create a Standalone Bundle Portable file application using Dlang? Could you describe what you mean with "Bundle portable file application"?

Re: Why many programmers don't like GC?

2021-01-15 Thread Imperatorn via Digitalmars-d-learn
On Friday, 15 January 2021 at 07:35:00 UTC, H. S. Teoh wrote: On Thu, Jan 14, 2021 at 12:36:12PM +, claptrap via Digitalmars-d-learn wrote: [...] [...] To be fair, the GC *has* improved over the years. Just not as quickly as people would like, but it *has* improved. [...] Nice

Re: Open question: what code pattern you use usually for null safety problem

2021-01-15 Thread Imperatorn via Digitalmars-d-learn
On Friday, 15 January 2021 at 14:25:09 UTC, Steven Schveighoffer wrote: On 1/15/21 9:19 AM, Steven Schveighoffer wrote: Something similar to BlackHole or WhiteHole. Essentially there's a default action for null for all types/fields/methods, and everything else is passed through. And now

Re: Static constructor

2021-01-15 Thread Imperatorn via Digitalmars-d-learn
On Friday, 15 January 2021 at 16:04:02 UTC, ludo wrote: I believe so. I've never used OpenAL so it may have additional restrictions with multithreading, but from a simple "This function is only ever executed on one thread at a time", your above suggestions should work. Apologies for the late

Re: To switch GC from FIFO to LIFO paradigm.

2021-01-15 Thread Imperatorn via Digitalmars-d-learn
On Friday, 15 January 2021 at 12:39:30 UTC, MGW wrote: GC cleans memory using the FIFO paradigm. Is it possible to switch GC to work using the LIFO paradigm? AFAIK the GC just sweeps, and the only queue is for destructors (unreachable memory) iirc

Re: C++ or D?

2020-12-31 Thread Imperatorn via Digitalmars-d-learn
On Thursday, 31 December 2020 at 14:56:37 UTC, Sebastiaan Koppe wrote: On Thursday, 31 December 2020 at 09:57:01 UTC, Imperatorn wrote: On Thursday, 31 December 2020 at 07:32:31 UTC, RSY wrote: [...] But they should be aware that C++ *as a language* has a long way to go before it gets all

Re: C++ or D?

2020-12-31 Thread Imperatorn via Digitalmars-d-learn
On Thursday, 31 December 2020 at 11:29:55 UTC, Ola Fosheim Grostad wrote: On Thursday, 31 December 2020 at 09:57:01 UTC, Imperatorn wrote: On Thursday, 31 December 2020 at 07:32:31 UTC, RSY wrote: nowhere. Just use D and be happy and let others use C++ and let them be happy. But they should be

Re: D static library on Windows 64 problem

2021-01-03 Thread Imperatorn via Digitalmars-d-learn
On Saturday, 2 January 2021 at 22:08:34 UTC, WhatMeWorry wrote: On Saturday, 2 January 2021 at 22:04:28 UTC, WhatMeWorry wrote: I'm stepping through the windows static library tutorial at http://prowiki.org/wiki4d/wiki.cgi?D__Tutorial/CompilingLinkingD#Linkingmanually [...] Oops. used the

Re: What does this code snippet even do?

2021-01-29 Thread Imperatorn via Digitalmars-d-learn
On Friday, 29 January 2021 at 22:59:14 UTC, H. S. Teoh wrote: On Fri, Jan 29, 2021 at 10:41:33PM +, WhatMeWorry via Digitalmars-d-learn wrote: [...] This means: "does the type of 'a' have the form U[], where U is a type that implicitly converts to T?". [...] This means: "does the

Re: How to profile compile times of a source code?

2021-01-31 Thread Imperatorn via Digitalmars-d-learn
On Saturday, 30 January 2021 at 23:34:50 UTC, Stefan Koch wrote: On Saturday, 30 January 2021 at 22:47:39 UTC, Ahmet Sait wrote: [...] I have a way of getting the profile data your are after. Get the dmd_tracing_20942 branch from https://github.com/UplinkCoder/dmd Compile that version of

Re: Minimize GC memory footprint

2021-01-31 Thread Imperatorn via Digitalmars-d-learn
On Sunday, 31 January 2021 at 04:12:14 UTC, frame wrote: On Saturday, 30 January 2021 at 22:57:41 UTC, Imperatorn wrote: On Saturday, 30 January 2021 at 16:42:35 UTC, frame wrote: Is there a way to force the GC to re-use memory in already existing pools? I set maxPoolSize:1 to gain pools

Re: How to profile compile times of a source code?

2021-01-31 Thread Imperatorn via Digitalmars-d-learn
On Sunday, 31 January 2021 at 12:31:59 UTC, Johan Engelen wrote: On Sunday, 31 January 2021 at 12:16:50 UTC, Imperatorn wrote: On Saturday, 30 January 2021 at 23:34:50 UTC, Stefan Koch wrote: [...] Interesting. Is this something that we could get into dmd with a switch? 樂 Try LDC 1.25

Re: Any tools to track heap/stack corruptions?

2021-02-03 Thread Imperatorn via Digitalmars-d-learn
On Wednesday, 3 February 2021 at 15:59:28 UTC, H. S. Teoh wrote: On Wed, Feb 03, 2021 at 03:47:34PM +, Imperatorn via Digitalmars-d-learn wrote: On Wednesday, 3 February 2021 at 14:00:23 UTC, JN wrote: > [...] [...] Or dustmite? https://dlang.org/blog/2020/04/13/dustmite-the-gene

Re: 200-600x slower Dlang performance with nested foreach loop

2021-01-26 Thread Imperatorn via Digitalmars-d-learn
On Tuesday, 26 January 2021 at 17:40:36 UTC, methonash wrote: Greetings Dlang wizards, I seek knowledge/understanding of a very frustrating phenomenon I've experienced over the past several days. [...] Source please 

Re: Initializing D runtime and executing module and TLS ctors for D libraries

2021-01-30 Thread Imperatorn via Digitalmars-d-learn
On Saturday, 30 January 2021 at 05:44:37 UTC, Ali Çehreli wrote: On 1/24/21 2:28 AM, IGotD- wrote: > [...] course. Any > [...] not do D > [...] [...] Hmm, interesting, or what you should call it  With this knowledge we have now, what changes could and/or should be made to make this

Re: Why filling AA in shared library freezes execution?

2021-01-30 Thread Imperatorn via Digitalmars-d-learn
On Friday, 29 January 2021 at 15:34:49 UTC, H. S. Teoh wrote: On Fri, Jan 29, 2021 at 12:45:02PM +, Imperatorn via Digitalmars-d-learn wrote: On Wednesday, 27 January 2021 at 15:25:17 UTC, H. S. Teoh wrote: > On Wed, Jan 27, 2021 at 02:39:08PM +, Adam D. Ruppe via > Digitalmars-d

Re: Initializing D runtime and executing module and TLS ctors for D libraries

2021-01-30 Thread Imperatorn via Digitalmars-d-learn
On Saturday, 30 January 2021 at 12:28:16 UTC, Ali Çehreli wrote: On 1/30/21 1:34 AM, Imperatorn wrote: > [...] should be > [...] I wonder whether doing something in the runtime is possible. For example, it may be more resilient and not crash when suspending a thread fails because the thread

Re: Why filling AA in shared library freezes execution?

2021-01-29 Thread Imperatorn via Digitalmars-d-learn
On Wednesday, 27 January 2021 at 15:25:17 UTC, H. S. Teoh wrote: On Wed, Jan 27, 2021 at 02:39:08PM +, Adam D. Ruppe via Digitalmars-d-learn wrote: On Wednesday, 27 January 2021 at 14:36:16 UTC, Adam D. Ruppe wrote: > (btw as for me fixing it myself oh edit, I should point out it also

Re: Minimize GC memory footprint

2021-01-30 Thread Imperatorn via Digitalmars-d-learn
On Saturday, 30 January 2021 at 16:42:35 UTC, frame wrote: Is there a way to force the GC to re-use memory in already existing pools? I set maxPoolSize:1 to gain pools that can be quicker released after there no longer in use. This already reduces memory usage to 1:3. Sadly the application

Refactoring tools

2021-02-02 Thread Imperatorn via Digitalmars-d-learn
As the title says: 1. Are there any (automated) refactoring tools for D? 2. If not, why? (Is D still too small?)

Re: Any tools to track heap/stack corruptions?

2021-02-03 Thread Imperatorn via Digitalmars-d-learn
On Wednesday, 3 February 2021 at 14:00:23 UTC, JN wrote: I am dealing with some nasty issue in my code. Basically random unrelated lines of code are crashing with access violations, and if I switch from dmd to ldc the crash goes away, or crash comes back, or it crashes in a different spot.

Re: Real simple unresolved external symbols question...

2021-02-11 Thread Imperatorn via Digitalmars-d-learn
On Thursday, 11 February 2021 at 00:18:23 UTC, H. S. Teoh wrote: On Wed, Feb 10, 2021 at 11:35:27PM +, WhatMeWorry via Digitalmars-d-learn wrote: [...] Okay, thanks. Then why does the README.md at https://github.com/dlang/druntime say "Runtime is typically linked together with Phobos in a

Re: Profiling

2021-02-11 Thread Imperatorn via Digitalmars-d-learn
On Wednesday, 10 February 2021 at 23:42:31 UTC, mw wrote: On Wednesday, 10 February 2021 at 11:52:51 UTC, JG wrote: As a follow up question I would like to know what tool people use to profile d programs? I use this one: https://code.dlang.org/packages/profdump e.g. ``` dub build

Re: code.dlang.org package search subtly broken?

2021-03-27 Thread Imperatorn via Digitalmars-d-learn
On Saturday, 27 March 2021 at 13:48:10 UTC, Brian wrote: Hello -- When I go to https://code.dlang.org and use the search function on the top right corner, it usually works fine. However, there was one package I knew I specifically wanted (png-d) but when I typed png-d into the search bar, I

Re: How to parse JSON in D?

2021-03-30 Thread Imperatorn via Digitalmars-d-learn
On Monday, 29 March 2021 at 18:19:35 UTC, Steven Schveighoffer wrote: On 3/29/21 1:48 PM, Imperatorn wrote: On Monday, 29 March 2021 at 17:21:25 UTC, tastyminerals wrote: [...] https://youtu.be/un-bZdyumog?t=27m25s FYI that package is here: https://code.dlang.org/packages/jsoniopipe I

Re: Need for speed

2021-04-01 Thread Imperatorn via Digitalmars-d-learn
On Thursday, 1 April 2021 at 17:30:15 UTC, Chris Piker wrote: On Thursday, 1 April 2021 at 16:52:17 UTC, Nestor wrote: I was hoping to beat my dear Python and get similar results to Go, but that is not the case neither using rdmd nor running the executable generated by dmd. I am getting values

Re: Need for speed

2021-04-01 Thread Imperatorn via Digitalmars-d-learn
On Thursday, 1 April 2021 at 19:00:08 UTC, Berni44 wrote: On Thursday, 1 April 2021 at 16:52:17 UTC, Nestor wrote: I was hoping to beat my dear Python and get similar results to Go, but that is not the case neither using rdmd nor running the executable generated by dmd. I am getting values

Re: Need for speed

2021-04-01 Thread Imperatorn via Digitalmars-d-learn
On Thursday, 1 April 2021 at 17:16:06 UTC, Imperatorn wrote: On Thursday, 1 April 2021 at 16:52:17 UTC, Nestor wrote: I am a python programmer and I am enjoying Dlang and learning some programming insights on the way, thank everyone. [...] Could you also post the python code for comparison?

Re: Need for speed

2021-04-01 Thread Imperatorn via Digitalmars-d-learn
On Thursday, 1 April 2021 at 16:52:17 UTC, Nestor wrote: I am a python programmer and I am enjoying Dlang and learning some programming insights on the way, thank everyone. [...] Could you also post the python code for comparison?

  1   2   3   >