Re: How to fix date format?

2017-04-25 Thread Jonathan M Davis via Digitalmars-d-learn
On Wednesday, April 26, 2017 04:02:12 Suliman via Digitalmars-d-learn wrote: > I tried to do: > > writeln(DateTime.toISOExtString(DateTime.fromSimpleString(point[1].coerce! > string))); > > But got error: > > Error: function std.datetime.DateTime.toISOExtString () const is > not callable using

Re: How to fix date format?

2017-04-25 Thread Ali Çehreli via Digitalmars-d-learn
On 04/25/2017 10:41 AM, Suliman wrote: I am using mysql native. Date in DB have next format: 2016-11-01 06:19:37 But every tile when I am trying to get it I am getting such format: 2016-Oct-31 15:37:24 I use next code: writeln(point[1].coerce!string); Why coerce is forcing format changing?

Re: How to fix date format?

2017-04-25 Thread Suliman via Digitalmars-d-learn
I tried to do: writeln(DateTime.toISOExtString(DateTime.fromSimpleString(point[1].coerce!string))); But got error: Error: function std.datetime.DateTime.toISOExtString () const is not callable using argument types (DateTime) Error: function database.Database.getSingleTrackInfo no return exp;

Re: How to fix date format?

2017-04-25 Thread Suliman via Digitalmars-d-learn
On Tuesday, 25 April 2017 at 20:10:02 UTC, Jonathan M Davis wrote: On Tuesday, April 25, 2017 17:41:25 Suliman via Digitalmars-d-learn wrote: I am using mysql native. Date in DB have next format: 2016-11-01 06:19:37 But every tile when I am trying to get it I am getting such format:

Re: multi-dimensional array whole slicing

2017-04-25 Thread XavierAP via Digitalmars-d-learn
On Tuesday, 25 April 2017 at 20:46:24 UTC, Ali Çehreli wrote: I think it's still consistent because the element type is not int in the case of multi-dimensional arrays. [...] int[3][4] b; b[] = [1, 1, 1]; It is consistent, I just miss the possibility to more easily initialize

Re: multi-dimensional array whole slicing

2017-04-25 Thread Ali Çehreli via Digitalmars-d-learn
On 04/23/2017 12:04 PM, XavierAP wrote: > For both multi-dimensional and > uni-dimensional arrays a[] and a[][] are the same. And yet, a[] has > different type in both cases and a[]=1 compiles for uni-dimensional but > not for multi-dimensional. I think it's still consistent because the element

Re: function type parameter inference not working

2017-04-25 Thread Ali Çehreli via Digitalmars-d-learn
On 04/25/2017 01:02 PM, XavierAP wrote: > It would be helpful if the error message talked about the ref qualifier > as the root cause instead of the consequent failure to infer template > parameters. That's a common request but the solution is not implemented yet because it's not trivial if

Re: How to fix date format?

2017-04-25 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, April 25, 2017 17:41:25 Suliman via Digitalmars-d-learn wrote: > I am using mysql native. Date in DB have next format: 2016-11-01 > 06:19:37 > > But every tile when I am trying to get it I am getting such > format: > 2016-Oct-31 15:37:24 > > I use next code: >

Re: function type parameter inference not working

2017-04-25 Thread XavierAP via Digitalmars-d-learn
On Tuesday, 25 April 2017 at 19:57:30 UTC, Ali Çehreli wrote: This is an intentional limitation of D. It's not possible to bind rvalues (temporaries) to reference parameters. The best option here is 'auto ref': Aha I had forgotten about the ref (obviously, otherwise I wouldn't have passed

Re: function type parameter inference not working

2017-04-25 Thread Ali Çehreli via Digitalmars-d-learn
On 04/25/2017 12:19 PM, XavierAP wrote: > void assembleMass1D(Mat, Vec)(ref Mat M, const ref Vec x) > { /* ... */ } > > Matrix!(2,2) M; > Vector!2 V; > assembleMass1D(M, V); // OK > assembleMass1D(M, Vector!2()); // ERROR template cannot deduce function > > > Is this a bug? This is

Re: function type parameter inference not working

2017-04-25 Thread XavierAP via Digitalmars-d-learn
On Sunday, 23 April 2017 at 19:40:39 UTC, ag0aep6g wrote: Please post self-contained code. When I fill the gaps you left, it works for me: Found it! It stops working (DMD v2.073.0 for Windows) if it has to infer the type of a temporary local variable -- constructed in place of the

Re: How to overload member function pointer and a regualr member function

2017-04-25 Thread Ali Çehreli via Digitalmars-d-learn
On 04/25/2017 11:54 AM, Ali Çehreli wrote: > _Dmain: > pushRBP > movRBP,RSP > subRSP,010h > movRAX,_D6deneme4funcFifZv@GOTPCREL[RIP] > mov-010h[RBP],RAX > movssXMM0,FLAT:.rodata[00h][RIP] > movss-8[RBP],XMM0 >

Re: How to overload member function pointer and a regualr member function

2017-04-25 Thread Ali Çehreli via Digitalmars-d-learn
On 04/25/2017 11:28 AM, ParticlePeter wrote: > On Tuesday, 25 April 2017 at 16:27:43 UTC, Basile B. wrote: >> with pragma(inline, true), the function body should be injected at the >> call sites. > > This would not help I fear, the body of the function pointer is unknown > in an external lib. I

Re: COM Expertise needed: COM Callbacks

2017-04-25 Thread Nierjerson via Digitalmars-d-learn
On Tuesday, 25 April 2017 at 10:03:30 UTC, Atila Neves wrote: On Monday, 24 April 2017 at 00:55:45 UTC, Nierjerson wrote: Still trying to get the com automation code working. This is a general issue with COM programming as I do not have the experience to solve the problem. [...] I tried

Re: How to overload member function pointer and a regualr member function

2017-04-25 Thread ParticlePeter via Digitalmars-d-learn
On Tuesday, 25 April 2017 at 16:27:43 UTC, Basile B. wrote: On Tuesday, 25 April 2017 at 15:43:48 UTC, ParticlePeter wrote: On Tuesday, 25 April 2017 at 09:50:14 UTC, Basile B. wrote: On Monday, 24 April 2017 at 16:46:21 UTC, ParticlePeter wrote: Thanks for your reply, but that's what I

Re: Set Intersection and Set Difference on Compile-Time lists

2017-04-25 Thread H. S. Teoh via Digitalmars-d-learn
On Tue, Apr 25, 2017 at 05:43:34PM +, David Sanders via Digitalmars-d-learn wrote: [...] > Order is not important. (float, int) is a subset of (int, int, float). > (int, int, float) is not the same thing as (int, float). Duplicates in > the list are considered to be distinct set members. > >

Re: Set Intersection and Set Difference on Compile-Time lists

2017-04-25 Thread David Sanders via Digitalmars-d-learn
On Tuesday, 25 April 2017 at 17:18:25 UTC, H. S. Teoh wrote: On Tue, Apr 25, 2017 at 05:08:36PM +, David Sanders via Digitalmars-d-learn wrote: I have two compile-time lists of types. How do I find their set intersection (to determine if one is a subset of the other) and their set

How to fix date format?

2017-04-25 Thread Suliman via Digitalmars-d-learn
I am using mysql native. Date in DB have next format: 2016-11-01 06:19:37 But every tile when I am trying to get it I am getting such format: 2016-Oct-31 15:37:24 I use next code: writeln(point[1].coerce!string); Why coerce is forcing format changing? How I can extract result as without

Re: Set Intersection and Set Difference on Compile-Time lists

2017-04-25 Thread H. S. Teoh via Digitalmars-d-learn
On Tue, Apr 25, 2017 at 05:08:36PM +, David Sanders via Digitalmars-d-learn wrote: > I have two compile-time lists of types. How do I find their set > intersection (to determine if one is a subset of the other) and their > set difference? See the block comments below: What's your definition

Set Intersection and Set Difference on Compile-Time lists

2017-04-25 Thread David Sanders via Digitalmars-d-learn
I have two compile-time lists of types. How do I find their set intersection (to determine if one is a subset of the other) and their set difference? See the block comments below: import std.variant; alias Zero = void; struct One{} struct Difference(T, U) { static if (is(U == Zero))

Re: How to overload member function pointer and a regualr member function

2017-04-25 Thread ParticlePeter via Digitalmars-d-learn
On Tuesday, 25 April 2017 at 09:50:14 UTC, Basile B. wrote: On Monday, 24 April 2017 at 16:46:21 UTC, ParticlePeter wrote: I would like to have this kind of struct: struct Foo { private int i; void function( int i, float f ) bar; // will be defined at runtime void bar( float f ) {

Re: using shared effectively in a producer/consumer situation.

2017-04-25 Thread Kagamin via Digitalmars-d-learn
On Sunday, 23 April 2017 at 20:33:48 UTC, Kevin Balbas wrote: Is this the correct way to do it? cast to shared, send to main thread, cast away shared? Yes, as long as the thing is unique, you can cast it to shared or immutable just fine.

Re: GC: Understanding potential sources of false pointers

2017-04-25 Thread Kagamin via Digitalmars-d-learn
They are for static data an thread-local storage.

Re: COM Expertise needed: COM Callbacks

2017-04-25 Thread Atila Neves via Digitalmars-d-learn
On Monday, 24 April 2017 at 00:55:45 UTC, Nierjerson wrote: Still trying to get the com automation code working. This is a general issue with COM programming as I do not have the experience to solve the problem. [...] I tried looking at this because I just did some COM work even if most of

Re: How to overload member function pointer and a regualr member function

2017-04-25 Thread Basile B. via Digitalmars-d-learn
On Monday, 24 April 2017 at 16:46:21 UTC, ParticlePeter wrote: I would like to have this kind of struct: struct Foo { private int i; void function( int i, float f ) bar; // will be defined at runtime void bar( float f ) { bar( i, f ); } } [...] How else can I get the required

Re: Why File is exists in std.stdio and in std.file?

2017-04-25 Thread FreeSlave via Digitalmars-d-learn
On Tuesday, 25 April 2017 at 07:05:51 UTC, Suliman wrote: Just interesting. Is there any rational reasons for this decision? There's no File in std.file. It's located in std.stdio. std.stdio and std.file are different modules. The first one has safe wrappers around stdio.h from C library, the

Re: Why File is exists in std.stdio and in std.file?

2017-04-25 Thread Daniel Kozák via Digitalmars-d-learn
V Tue, 25 Apr 2017 07:05:51 + Suliman via Digitalmars-d-learn napsáno: > Just interesting. Is there any rational reasons for this decision? No it isn't. File is only in std.stdio;

Why File is exists in std.stdio and in std.file?

2017-04-25 Thread Suliman via Digitalmars-d-learn
Just interesting. Is there any rational reasons for this decision?