Re: Access visibility and linkage

2018-02-14 Thread Seb via Digitalmars-d-learn
On Thursday, 15 February 2018 at 06:43:52 UTC, Arun Chandrasekaran wrote: I was reading through https://wiki.dlang.org/Access_specifiers_and_visibility#What_is_missing [...] DMD v2.077.1 exhibits the same behavior. Is this is already being worked on? Or is there any plan to address this?

Access visibility and linkage

2018-02-14 Thread Arun Chandrasekaran via Digitalmars-d-learn
I was reading through https://wiki.dlang.org/Access_specifiers_and_visibility#What_is_missing There is currently no way in D to mark symbols for internal linkage, saying "this an implementation detail, you should not even know this one exists". This is an important module-level encapsulation

Re: Disk space used and free size of a Network share folder in Windows

2018-02-14 Thread psychoticRabbit via Digitalmars-d-learn
On Wednesday, 14 February 2018 at 15:24:42 UTC, Vino wrote: ...the only problem is i am not sure hot to get the out put without the headings(Caption FreeSpace,Size) any help on same is much appreciated. writeln(result.output[38..$]);

Re: opCast cannot implicitly convert a.opCast of type X to Y

2018-02-14 Thread aliak via Digitalmars-d-learn
On Thursday, 15 February 2018 at 00:34:33 UTC, Meta wrote: On Thursday, 15 February 2018 at 00:27:40 UTC, Meta wrote: On Wednesday, 14 February 2018 at 23:46:30 UTC, aliak wrote: On Wednesday, 14 February 2018 at 15:14:24 UTC, Meta wrote: Ooh yes, of course! Thank you :) Even better:

Re: opCast cannot implicitly convert a.opCast of type X to Y

2018-02-14 Thread Meta via Digitalmars-d-learn
On Thursday, 15 February 2018 at 00:27:40 UTC, Meta wrote: On Wednesday, 14 February 2018 at 23:46:30 UTC, aliak wrote: On Wednesday, 14 February 2018 at 15:14:24 UTC, Meta wrote: Ooh yes, of course! Thank you :) Even better: import std.conv; auto b = a.map!(to!float); Actually, that

Re: opCast cannot implicitly convert a.opCast of type X to Y

2018-02-14 Thread Meta via Digitalmars-d-learn
On Wednesday, 14 February 2018 at 23:46:30 UTC, aliak wrote: On Wednesday, 14 February 2018 at 15:14:24 UTC, Meta wrote: I think the best way to do this is to implement `map` for your optional type. Optional!U map(U, alias f)() { return empty? no!U : some!U(f(t)); } Optional!int a = 3;

Re: opCast cannot implicitly convert a.opCast of type X to Y

2018-02-14 Thread aliak via Digitalmars-d-learn
On Wednesday, 14 February 2018 at 15:14:24 UTC, Meta wrote: I think the best way to do this is to implement `map` for your optional type. Optional!U map(U, alias f)() { return empty? no!U : some!U(f(t)); } Optional!int a = 3; auto b = a.map!(v => cast(float)v); assert(is(typeof(b) ==

Re: Disk space used and free size of a Network share folder in Windows

2018-02-14 Thread FreeSlave via Digitalmars-d-learn
On Wednesday, 14 February 2018 at 15:24:42 UTC, Vino wrote: On Wednesday, 14 February 2018 at 12:29:13 UTC, rikki cattermole wrote: [...] Hi Rikki, Wouldn't this be easy to use with std.process: execute package and calling wmic.exe, the only problem is i am not sure hot to get the out

Re: vib.d suppress 404 for no content written

2018-02-14 Thread Seb via Digitalmars-d-learn
On Wednesday, 14 February 2018 at 21:16:23 UTC, aberba wrote: Seb, are you the one doing the vibe.d demo collections? Do you mean this? https://github.com/wilzbach/vibe-d-by-example Yes, that's me, but it still needs a lot of work and I haven't got around polishing it for an alpha

Re: vib.d suppress 404 for no content written

2018-02-14 Thread aberba via Digitalmars-d-learn
On Wednesday, 14 February 2018 at 14:58:14 UTC, Seb wrote: On Wednesday, 14 February 2018 at 14:30:19 UTC, Nicholas Wilson wrote: I have an endpoint that is a post: void postStuff(HTTPServerRequest req, HTTPServerResponse res) { // do some stuff with req res.statusCode = 200; } I do

Re: unable to fork: Cannot allocate memory / core.checkedint / gtkd

2018-02-14 Thread number via Digitalmars-d-learn
On Tuesday, 13 February 2018 at 21:46:31 UTC, Stefan Koch wrote: On Tuesday, 13 February 2018 at 14:10:44 UTC, number wrote: Ok, thanks for the info. I guess I'll just use printf then for larger enums. To get the same convince you can use. the enumToString from:

Re: vib.d suppress 404 for no content written

2018-02-14 Thread Nicholas Wilson via Digitalmars-d-learn
On Wednesday, 14 February 2018 at 14:58:14 UTC, Seb wrote: On Wednesday, 14 February 2018 at 14:30:19 UTC, Nicholas Wilson wrote: I have an endpoint that is a post: void postStuff(HTTPServerRequest req, HTTPServerResponse res) { // do some stuff with req res.statusCode = 200; } I do

Re: Disk space used and free size of a Network share folder in Windows

2018-02-14 Thread Vino via Digitalmars-d-learn
On Wednesday, 14 February 2018 at 12:29:13 UTC, rikki cattermole wrote: On 14/02/2018 12:22 PM, Vino wrote: Hi All,  Request your help on how to get the disk space used and free size of a Network share folder in Windows, tried with getSize but it return 0; eg: Share Name :\\server1\dir1$

Re: opCast cannot implicitly convert a.opCast of type X to Y

2018-02-14 Thread Meta via Digitalmars-d-learn
On Monday, 12 February 2018 at 02:05:16 UTC, aliak wrote: From spec: Cast expression: "cast ( Type ) UnaryExpression" converts UnaryExpresssion to Type. And https://dlang.org/spec/operatoroverloading.html#cast makes no mention of the return type of opCast. One could think that the return

Re: vib.d suppress 404 for no content written

2018-02-14 Thread Seb via Digitalmars-d-learn
On Wednesday, 14 February 2018 at 14:30:19 UTC, Nicholas Wilson wrote: I have an endpoint that is a post: void postStuff(HTTPServerRequest req, HTTPServerResponse res) { // do some stuff with req res.statusCode = 200; } I do not write anything to res (deliberately) but want to set the

vib.d suppress 404 for no content written

2018-02-14 Thread Nicholas Wilson via Digitalmars-d-learn
I have an endpoint that is a post: void postStuff(HTTPServerRequest req, HTTPServerResponse res) { // do some stuff with req res.statusCode = 200; } I do not write anything to res (deliberately) but want to set the status code. However it returns 404, because no content is written.

Re: Disk space used and free size of a Network share folder in Windows

2018-02-14 Thread rikki cattermole via Digitalmars-d-learn
On 14/02/2018 1:52 PM, psychoticRabbit wrote: On Wednesday, 14 February 2018 at 12:29:13 UTC, rikki cattermole wrote: See: https://msdn.microsoft.com/en-us/library/windows/desktop/aa364935(v=vs.85).aspx any idea on how I'd convert this C# code to D? == public

Re: Disk space used and free size of a Network share folder in Windows

2018-02-14 Thread psychoticRabbit via Digitalmars-d-learn
On Wednesday, 14 February 2018 at 12:29:13 UTC, rikki cattermole wrote: See: https://msdn.microsoft.com/en-us/library/windows/desktop/aa364935(v=vs.85).aspx any idea on how I'd convert this C# code to D? == public class Program { [DllImport("kernel32.dll")]

Re: Disk space used and free size of a Network share folder in Windows

2018-02-14 Thread rikki cattermole via Digitalmars-d-learn
On 14/02/2018 12:22 PM, Vino wrote: Hi All,  Request your help on how to get the disk space used and free size of a Network share folder in Windows, tried with getSize but it return 0; eg: Share Name :\\server1\dir1$ From, Vino.B See:

Disk space used and free size of a Network share folder in Windows

2018-02-14 Thread Vino via Digitalmars-d-learn
Hi All, Request your help on how to get the disk space used and free size of a Network share folder in Windows, tried with getSize but it return 0; eg: Share Name :\\server1\dir1$ From, Vino.B

Re: rdmd main.d leads to Segmentation fault

2018-02-14 Thread Martin Tschierschke via Digitalmars-d-learn
On Wednesday, 14 February 2018 at 10:28:51 UTC, Kagamin wrote: On Tuesday, 13 February 2018 at 06:53:46 UTC, Martin Tschierschke wrote: I am unfamiliar with debugging (gdb etc.) so any hint would be appreciated! https://issues.dlang.org/show_bug.cgi?id=18350 - maybe adjust bug severity. I

Re: dmd-2.078.2 problems with Ubuntu 17.10 32Bit

2018-02-14 Thread Andrea Fontana via Digitalmars-d-learn
On Wednesday, 14 February 2018 at 11:16:25 UTC, Martin Tschierschke wrote: Ok, good to know! I started with 16.04 and made the initial mistake to take the 32 Bit version, do you use 32 or 64 Bit? 64bit of course! Andrea

Re: dmd-2.078.2 problems with Ubuntu 17.10 32Bit

2018-02-14 Thread Martin Tschierschke via Digitalmars-d-learn
On Wednesday, 14 February 2018 at 10:57:47 UTC, Andrea Fontana wrote: On Tuesday, 13 February 2018 at 22:21:18 UTC, Martin Tschierschke wrote: I will downgrade to 16.04., the dist-upgrade to 17.10 was a mistake, resulting in problems with startx and newer kernels so I have to use 4.10. In my

Re: dmd-2.078.2 problems with Ubuntu 17.10 32Bit

2018-02-14 Thread Andrea Fontana via Digitalmars-d-learn
On Tuesday, 13 February 2018 at 22:21:18 UTC, Martin Tschierschke wrote: I will downgrade to 16.04., the dist-upgrade to 17.10 was a mistake, resulting in problems with startx and newer kernels so I have to use 4.10. In my experience dist-upgrade are long and messy :) Usually I create a

Re: rdmd main.d leads to Segmentation fault

2018-02-14 Thread Kagamin via Digitalmars-d-learn
On Tuesday, 13 February 2018 at 06:53:46 UTC, Martin Tschierschke wrote: I am unfamiliar with debugging (gdb etc.) so any hint would be appreciated! https://issues.dlang.org/show_bug.cgi?id=18350 - maybe adjust bug severity.