Re: Idiomatic way to write a range that tracks how much it consumes

2020-04-26 Thread Jon Degenhardt via Digitalmars-d-learn
On Monday, 27 April 2020 at 04:51:54 UTC, Steven Schveighoffer wrote: On 4/26/20 11:38 PM, Jon Degenhardt wrote: Is there a better way to write this? I had exactly the same problems. I created this to solve the problem, I've barely tested it, but I plan to use it with all my parsing

Re: Idiomatic way to write a range that tracks how much it consumes

2020-04-26 Thread Jon Degenhardt via Digitalmars-d-learn
On Monday, 27 April 2020 at 04:41:58 UTC, drug wrote: 27.04.2020 06:38, Jon Degenhardt пишет: Is there a better way to write this? --Jon I don't know a better way, I think you enlist all possible ways - get a value using either `front` or special range member. I prefer the second variant,

Re: Idiomatic way to write a range that tracks how much it consumes

2020-04-26 Thread anon via Digitalmars-d-learn
To implement your option A you could simply use std.range.enumerate. Would something like this work? import std.algorithm.iteration : map; import std.algorithm.searching : until; import std.range : tee; size_t bytesConsumed; auto result = input.map!(a => a.yourTransformation )

Re: Idiomatic way to write a range that tracks how much it consumes

2020-04-26 Thread Steven Schveighoffer via Digitalmars-d-learn
On 4/26/20 11:38 PM, Jon Degenhardt wrote: I have a string that contains a sequence of elements, then a terminator character, followed by a different sequence of elements (of a different type). I want to create an input range that traverses the initial sequence. This is easy enough. But

Re: Idiomatic way to write a range that tracks how much it consumes

2020-04-26 Thread drug via Digitalmars-d-learn
27.04.2020 06:38, Jon Degenhardt пишет: Is there a better way to write this? --Jon I don't know a better way, I think you enlist all possible ways - get a value using either `front` or special range member. I prefer the second variant, I don't think it is less consistent with range

Idiomatic way to write a range that tracks how much it consumes

2020-04-26 Thread Jon Degenhardt via Digitalmars-d-learn
I have a string that contains a sequence of elements, then a terminator character, followed by a different sequence of elements (of a different type). I want to create an input range that traverses the initial sequence. This is easy enough. But after the initial sequence has been traversed,

Re: Newbie linker errors - still missing _fltused _tls_index _tls_used localtime tzset mainCRTStartup

2020-04-26 Thread malpropism via Digitalmars-d-learn
Thanks for your suggestion. In VS 2017, the Property Pages have a configuration drop down list box which allows you select among Active(Debug), Debug, Release, and All Configurations. Mine was set to All Configurations, leaving me to believe that setting something would apply to both Debug

Re: How to do HEAD request in std.net.curl

2020-04-26 Thread data pulverizer via Digitalmars-d-learn
On Sunday, 26 April 2020 at 22:03:33 UTC, data pulverizer wrote: Hi all, I am using std.net.curl and would like to run a HEAD request to find out if a web page exists - I've looked at the documentation and have tried various things that haven't worked. Thanks Never mind, I've got it, the

Re: Can't get dub dustmite to work

2020-04-26 Thread aliak via Digitalmars-d-learn
On Saturday, 25 April 2020 at 18:52:45 UTC, Andre Pany wrote: How do you call dub test causing the issue? Maybe there is a difference in the configuration/build type. I'm sorry I didn't follow. You mean like: "dub test" ?? I dont pass anything to the -b or -c flag if that's what you

Re: Can't get dub dustmite to work

2020-04-26 Thread aliak via Digitalmars-d-learn
On Saturday, 25 April 2020 at 19:00:55 UTC, Anonymouse wrote: On Saturday, 25 April 2020 at 09:38:59 UTC, aliak wrote: Then I run this dub dustmite command: dub dustmite -b unittest ../dubdust --compiler-regex="never matches" I have had zero luck with dustmite via dub. I would honestly

How to do HEAD request in std.net.curl

2020-04-26 Thread data pulverizer via Digitalmars-d-learn
Hi all, I am using std.net.curl and would like to run a HEAD request to find out if a web page exists - I've looked at the documentation and have tried various things that haven't worked. Thanks

Re: Newbie linker errors - still missing _fltused _tls_index _tls_used localtime tzset mainCRTStartup

2020-04-26 Thread welkam via Digitalmars-d-learn
If I remember correctly VS studio has different release and debug configurations for both compiler and linker. If release works but debug doesnt make sure that when you add things to one to also add to another

Re: DConf 2017 Videos

2020-04-26 Thread Steven Schveighoffer via Digitalmars-d-learn
On 4/25/20 7:11 AM, Jacob Carlborg wrote: On 2020-04-24 22:24, matheus wrote: Hi, please could someone tell me where can I find videos from DConf 2017? I pretty sure I watched them on Youtube sometime ago, but I can't find anymore. By the way, I'm looking from one video where someone shows

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

2020-04-26 Thread drug via Digitalmars-d-learn
26.04.2020 11:06, mark пишет: snipped Sorry for offtopic, imho both Qt and Gtk are too complex in case of virtual list/tree view. I think the reason is they are retained mode gui. I gave up to use them for that and develop custom virtual tree view that is easy in use and currently capable

Re: DConf 2017 Videos

2020-04-26 Thread Murilo via Digitalmars-d-learn
On Friday, 24 April 2020 at 20:24:47 UTC, matheus wrote: Hi, please could someone tell me where can I find videos from DConf 2017? I pretty sure I watched them on Youtube sometime ago, but I can't find anymore. By the way, I'm looking from one video where someone shows some "C flaws" and

Re: Newbie linker errors - still missing _fltused _tls_index _tls_used localtime tzset mainCRTStartup

2020-04-26 Thread malpropism via Digitalmars-d-learn
Thanks for very prompt reply and apologies for my extremely late answer. Due to the current situation, I now have much more time to work on this. In short, I upgraded to the most recent (1.20.1) LDC compiler, the most recent (0.52.0) Visual D, but am staying with VS 2017. When I try to

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

2020-04-26 Thread Mike Wey via Digitalmars-d-learn
On 26-04-2020 10:06, mark wrote: I'm trying to develop an application in GtkD. I need a widget to display a list of strings: there could be anything from 0 to 100K strings, but typically a few hundred or thousand. Using the DemoCustomList as a model I have created this code: ... When

Re: GUI library for DMD 2.090 or DMD 2.091

2020-04-26 Thread Antonio Corbi via Digitalmars-d-learn
On Saturday, 25 April 2020 at 09:30:44 UTC, Paulo Pinto wrote: On Friday, 24 April 2020 at 18:52:55 UTC, Russel Winder wrote: [...] Just curious, how do you handle the whole RC> story in Gtk-rs? For me it made the point that languages with tracing GC or implicit reference counting are

Re: GUI library for DMD 2.090 or DMD 2.091

2020-04-26 Thread dangbinghoo via Digitalmars-d-learn
On Friday, 24 April 2020 at 13:45:22 UTC, Phrozen wrote: I'm too new to DLang and I have a lot to learn. Probably that's why I have a lot of difficulties. Has anyone tried using a GUI library to the latest DMD 2.090 or DMD 2.091? I plan to use this language for a specific Thermal calculator

GtkD - how to list 0..100K strings

2020-04-26 Thread mark via Digitalmars-d-learn
I'm trying to develop an application in GtkD. I need a widget to display a list of strings: there could be anything from 0 to 100K strings, but typically a few hundred or thousand. Using the DemoCustomList as a model I have created this code: // Note: DebNames is an AAset!string (AAset is a