Re: std.datetime & timzone specifier: 2018-11-06T16:52:03+01:00

2020-03-08 Thread tchaloupka via Digitalmars-d-learn
On Sunday, 8 March 2020 at 17:28:33 UTC, Robert M. Münch wrote: On 2020-03-07 12:10:27 +, Jonathan M Davis said: DateTime dt = DateTime.fromISOExtString(split("2018-11-06T16:52:03+01:00", regex("\\+"))[0]); IMO such a string should be feedable directly to the function. You just need

Re: std.datetime & timzone specifier: 2018-11-06T16:52:03+01:00

2020-03-08 Thread kdevel via Digitalmars-d-learn
On Sunday, 8 March 2020 at 17:28:33 UTC, Robert M. Münch wrote: [...] But I have to do: DateTime dt = DateTime.fromISOExtString(split("2018-11-06T16:52:03+01:00", regex("\\+"))[0]); You don't need a regex. split (..., '+') seems to suffice here. IMO such a string should be feedable

Re: Converting Lua source to D

2020-03-08 Thread Jesse Phillips via Digitalmars-d-learn
On Saturday, 7 March 2020 at 01:14:14 UTC, Jesse Phillips wrote: Now I should look at getting the CI up and Test failure fixed. Test failures were my local system and related to the stack overflow tests. I have the build pipeline up and running but hit a couple of snags.

Re: static foreach / How to construct concatenated string?

2020-03-08 Thread Robert M. Münch via Digitalmars-d-learn
On 2020-03-07 16:41:47 +, MoonlightSentinel said: You can use an anonymous lambda to build the string in CTFE: -- struct S { int a; bool b; } import std; enum string sql = { string s = "CREATE TABLE data("; static foreach(f;

Re: How to use sets in D?

2020-03-08 Thread Jesse Phillips via Digitalmars-d-learn
On Friday, 7 February 2020 at 19:37:08 UTC, mark wrote: I am porting code from other languages to D as part of learning D, and I find I've used sets quite a lot. AFAIK D doesn't have a built-in set type or one in the std. lib. However, I've been perfectly successfully using int[E] where E is

Re: Just a Reminder...

2020-03-08 Thread Brakeran via Digitalmars-d-learn
On Monday, 24 February 2020 at 17:47:37 UTC, Ron Tarrant wrote: In case you thought the GtkDcoding blog announcements have stopped, I just want to let you know that starting with #0101, they'll be made in the Announce sub-forum from now on. This is where they were originally supposed to be

Re: Can't compile dlangui

2020-03-08 Thread Brakeran via Digitalmars-d-learn
On Friday, 7 February 2020 at 14:25:05 UTC, Jan Hönig wrote: On Friday, 7 February 2020 at 12:04:10 UTC, A.Perea wrote: [...] I am afraid that dlangui and dlangide is currently not maintained, since i can reproduce the error as well. If you are looking for a good editor for D: I am using

Re: A small D/GtkD example game

2020-03-08 Thread Brakeran via Digitalmars-d-learn
On Monday, 24 February 2020 at 19:18:24 UTC, mark wrote: I've just completed a small D/GtkD game. It might be useful for others trying to learn GtkD since it is only just over 1000 lines, yet shows how to create a dialog-style app with a modal dialog and a modeless dialog, and a custom drawn

Re: std.datetime & timzone specifier: 2018-11-06T16:52:03+01:00

2020-03-08 Thread Robert M. Münch via Digitalmars-d-learn
On 2020-03-07 12:10:27 +, Jonathan M Davis said: I take it that you're asking why you don't get the time zone as part of the string when you call one of the to*String functions? The problem is, the from* functions give an error, that this is not an ISO date. I get this in an XML

Re: static foreach / How to construct concatenated string?

2020-03-08 Thread Robert M. Münch via Digitalmars-d-learn
On 2020-03-07 16:41:47 +, MoonlightSentinel said: On Saturday, 7 March 2020 at 16:30:59 UTC, Robert M. Münch wrote: Is this possible at all? You can use an anonymous lambda to build the string in CTFE: -- struct S { int a; bool b; }

Re: How to use sets in D?

2020-03-08 Thread Johan via Digitalmars-d-learn
On Sunday, 8 March 2020 at 08:43:10 UTC, mark wrote: Here are some timings ... [...] #!/usr/bin/env rdmd Please remember that performance testing is not trivial. At the very least, you should be testing optimized code (-O) and preferably with LDC or GDC because they have a much stronger

Re: How to use sets in D?

2020-03-08 Thread mark via Digitalmars-d-learn
I use sets a lot and am now working on a program that will need to hold sets of 65,000+ items, so I thought I do some timings for the different approaches. Here are some timings (uset uses the AA Unit approach, tset uses an rbtree, and aset uses an AA with bool values): $ ./sets.d size