Re: precise GC

2019-03-04 Thread KnightMare via Digitalmars-d-learn
/* English is not my native, and I tried to use Google translate. I hope u will understand subtleties of questions */ For precise-GC: 3) closures: do the closures have any internal types that helps to GC or are they (full closure memory block) scanned as in the conservative mode? 4)

precise GC

2019-03-04 Thread KnightMare via Digitalmars-d-learn
As I understood conservative-GC scans all allocated memory blocks for false pointers. In other hand precise-GC scans only explicit memory blocks that contains (objects of types that contains) pointers/refs or "muddy" types (void, void[]...). For example, we have some rooted memory block as

Re: precise GC

2019-03-04 Thread KnightMare via Digitalmars-d-learn
IMO need more explanations about precise-GC and cases where behavior of precise and conservative same and differs

Re: how to define infix function

2019-04-11 Thread KnightMare via Digitalmars-d-learn
u can use infix function with 1arg without any parentheses. UPD with 2args arg1 `infix func` arg2 latter I told about UFCS with 1arg `UFCS func` arg1

Re: how to define infix function

2019-04-11 Thread KnightMare via Digitalmars-d-learn
On Saturday, 2 June 2018 at 22:01:02 UTC, Ali Çehreli wrote: On 06/02/2018 02:44 PM, greatsam4sure wrote: > is it possible to define infix function in D > 3.min(5)// 3: where min is a function, works in D > 3 min 5 // does not work. This is called universal function call syntax (UFCS) in D. Ali

Re: 1 - 17 ms, 553 ╬╝s, and 1 hnsec

2019-05-28 Thread KnightMare via Digitalmars-d-learn
Why not simply 17.5531 ms ("%.4f ms") to get rid of the non-ASCII µ prefix? fwiw I like this solution for the output. It is very clear to me. +1 and without space 17.5531ms

Re: emulate with

2019-05-31 Thread KnightMare via Digitalmars-d-learn
imo for parts of names such things will never appear.. names, subnames, overloading.. hell no but I want Kotlin lambdas https://kotlinlang.org/docs/reference/lambdas.html I want more: Function literals with receiver it: implicit name of a single parameter Passing a lambda to the last parameter

Re: Reading Dicom files in Dlang

2019-05-31 Thread KnightMare via Digitalmars-d-learn
whats wrong with answer at SO? https://stackoverflow.com/questions/56278268/reading-dicom-files-in-dlang

Re: Reading Dicom files in Dlang

2019-05-31 Thread KnightMare via Digitalmars-d-learn
struct Range { private __vector(ushort) _outer; private size_t _a, _b; this(vector(ushort) data, size_t a, size_t b) { // line 457 _outer = data; _a = a; _b = b; } imo problem is in string private __vector(ushort)_outer; it looks like

Re: Reading .pem files for secured

2019-05-31 Thread KnightMare via Digitalmars-d-learn
The reason is that if I understand the logic of Base64, it's that each character stores 6 bits. My private key .pem has 49 lines of 64 characters worth of Base64, though the sat line isn't full. Anyway, this is data worth of over 18000 bits. The RSA key is supposed to be 4096 bits, so this

Re: Reading .pem files for secured

2019-05-31 Thread KnightMare via Digitalmars-d-learn
https://lapo.it/asn1js but dont insert ur certificate there, generate new one for tests

Re: if (X !is null && X.Y !is null) access crash

2019-06-07 Thread KnightMare via Digitalmars-d-learn
On Friday, 7 June 2019 at 09:26:52 UTC, Amex wrote: if (X !is null && X.Y !is null) access crash is crashing. imo this code is valid. u can write shorter if (X && X.Y) probably crashed in some another place (X is not objRef but something else.. some code later at same line.. dunno)

Re: Linker error: _D6object__T10RTInfoImplVAmA2i48i57ZQyyG2m

2019-05-30 Thread KnightMare via Digitalmars-d-learn
widgets.obj : error LNK2001: Nicht aufgelöstes externes Symbol "_D6object__T10RTInfoImplVAmA2i48i57ZQyyG2m". widgets.obj : error LNK2001: Nicht aufgelöstes externes Symbol "_D6object__T10RTInfoImplVAmA2i32i14ZQyyG2m". immutable(ulong[2]) object.RTInfoImpl!([48, 57]).RTInfoImpl

Re: D compiler need -nogc witch and document of library also need nogc button

2019-06-11 Thread KnightMare via Digitalmars-d-learn
On Tuesday, 11 June 2019 at 08:05:31 UTC, dangbinghoo wrote: I think that D compiler needs -nogc switch to fully disable gc for a project, LDC -nogc? and document of phobos also needs a friendly way to list-out all @nogc API. +1 people who are interested only in betterC/nogc shouldn't

Re: D compiler need -nogc witch and document of library also need nogc button

2019-06-11 Thread KnightMare via Digitalmars-d-learn
On Tuesday, 11 June 2019 at 12:42:03 UTC, Adam D. Ruppe wrote: On Tuesday, 11 June 2019 at 10:24:05 UTC, KnightMare wrote: people who are interested only in betterC/nogc shouldn't see documentation to api that they are not suitable. I've considered doing that before, but it is actually

Re: D compiler need -nogc witch and document of library also need nogc button

2019-06-11 Thread KnightMare via Digitalmars-d-learn
On Tuesday, 11 June 2019 at 14:44:20 UTC, KnightMare wrote: Stroustrup said about C++ (not exactly quote. I translated it from my lang not English): since C and C ++ will be used by the same people on many years, the differences between languages should be either minimal or maximal to minimize

Re: Elegant way to test if members of array A are present in array B?

2019-06-11 Thread KnightMare via Digitalmars-d-learn
On Tuesday, 11 June 2019 at 17:12:17 UTC, Robert M. Münch wrote: Is there a simple and elegant way to do this? Or is just using a foreach(...) with canFind() the best way? not elegant, not simple. for byte/short/ubye/ushort only https://www.strchr.com/strcmp_and_strlen_using_sse_4.2

Re: Elegant way to test if members of array A are present in array B?

2019-06-11 Thread KnightMare via Digitalmars-d-learn
On Tuesday, 11 June 2019 at 18:39:38 UTC, KnightMare wrote: probably strstr https://dlang.org/library/core/stdc/string/strstr.html implemented over it. there is a tendency to remove dependency from C-runtime. *FIX* strpbrk https://dlang.org/phobos/core_stdc_string.html#.strpbrk

need article: How is working D-GC?

2019-06-11 Thread KnightMare via Digitalmars-d-learn
please write some explanation about subj. - what exactly it scans? - why it scan data-segment? https://issues.dlang.org/show_bug.cgi?id=15723 https://issues.dlang.org/show_bug.cgi?id=19947 precise GC doesn't help with issues. - maybe add new type like gcpointer or something (making word

Re: create and initialise array

2019-06-20 Thread KnightMare via Digitalmars-d-learn
On Thursday, 20 June 2019 at 01:32:04 UTC, matheus wrote: import std.stdio; import std.array; void main(){ auto s = uninitializedArray!(float[])(100); s[] = 0.0f; writeln(s[0]); } another version: auto arr = new double[ 10 ]; writeln( arr[5] ); // NaN arr.length += 10; writeln(

Re: What is iota function full name

2019-06-21 Thread KnightMare via Digitalmars-d-learn
On Friday, 21 June 2019 at 12:02:10 UTC, Jonathan M Davis wrote: On Friday, June 21, 2019 5:10:03 AM MDT JN via Some folks argued a while back that iota was a terrible name and that it should be changed, but it was decided not to change it. auto terribleName( ... ) { } auto goodName( ...

Re: What is iota function full name

2019-06-21 Thread KnightMare via Digitalmars-d-learn
On Friday, 21 June 2019 at 19:18:02 UTC, KnightMare wrote: On Friday, 21 June 2019 at 12:02:10 UTC, Jonathan M Davis wrote: auto goodName( ... ) { pragma( inline, true ) return terribleName( ... ); } hmm.. I have a question: this pragma will inline terribleName (double code) or

Re: Using std.algorithm.iteration to Calculate Hamming Distance

2019-06-23 Thread KnightMare via Digitalmars-d-learn
On Sunday, 23 June 2019 at 13:10:51 UTC, Samir wrote: D already has a function to calculate the Levenshtein distance[1]. I am trying to come up with a function to calculate the Hamming distance[2] between two strings, `a` and `b`. So far, this seems to work: foreach (i, j; zip(a, b)) {

Re: How to "Clear the Screen" for Windows Command Processor? (Windows 10)

2019-05-21 Thread KnightMare via Digitalmars-d-learn
try next: spawnShell( "cls" ).wait;